I get the above error message when I click on a listbox that's inside a form. Here's the code that causes the problem:Private Sub Search_Area_AfterUpdate() Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[Applicant ID] = " & Str(Me![Search2]) Me.Bookmark = rs.BookmarkEnd Sub
Search_Area is the list box.Key_Word_Input is a text box on the form for inputting the search criteria.Search2 is another text box (insivible) that's located on the form.Applicant ID is the first column in the list box (there's a total of 5 columns).Only entries that have the criteria typed into Key_Word_Input in one of their fields should show up in the list box.Here's the code for the the input box:Private Sub Key_Word_Input_Change()Dim vSearchString As String vSearchString = Key_Word_Input.Text Search2.Value = vSearchString Me.Search_Area.RequeryEnd Sub
Here's the code for the "Reset" button.Private Sub ClearIt_Click()On Error GoTo Err_ClearItMe.Key_Word_Input = "" Me.Search2 = "" Me.Search_Area.Requery Me.Search_Area.SetFocusExit_ClearIt_Click: Exit SubErr_ClearIt: MsgBox Err.Description Resume Exit_ClearIt_ClickEnd Sub
Note that the structure was lifted from a sample database found on the web. Prior to this I tried to simply insert a subform into the main form and then have it filtered according to the words typed in. This didn't work and after quite a few hours of futile work I tried the listbox approach. It works perfectly in the sample database but not for me. I am really lost.Not only does it crash when I click on the listbox but it also doesn't filter anything.