Access_Person
Registered User.
- Local time
- Yesterday, 22:23
- Joined
- Aug 18, 2004
- Messages
- 14
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:
Edit:The set rs = ..... line causes the error.
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:
Here's the code for the "Reset" button.
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.
Also note that I have attachd a screenshot of the form for easier visualization. The combo box for selecting the field is a relic from my first attempt, as is the "Search" button: right now it's supposed to filter as you type in the text.
Edit:The set rs = ..... line causes the error.
Code:
Private Sub Search_Area_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Applicant ID] = " & Str(Me![Search2])
Me.Bookmark = rs.Bookmark
End Sub
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:
Code:
Private Sub Key_Word_Input_Change()
Dim vSearchString As String
vSearchString = Key_Word_Input.Text
Search2.Value = vSearchString
Me.Search_Area.Requery
End Sub
Here's the code for the "Reset" button.
Code:
Private Sub ClearIt_Click()
On Error GoTo Err_ClearIt
Me.Key_Word_Input = ""
Me.Search2 = ""
Me.Search_Area.Requery
Me.Search_Area.SetFocus
Exit_ClearIt_Click:
Exit Sub
Err_ClearIt:
MsgBox Err.Description
Resume Exit_ClearIt_Click
End 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.
Also note that I have attachd a screenshot of the form for easier visualization. The combo box for selecting the field is a relic from my first attempt, as is the "Search" button: right now it's supposed to filter as you type in the text.