Hello,
I currently have a list box that filters though a list of records on the main form using a text box.
I have got the search function working, and the list box filters correctly, the problem I am having is that I need to be able to double click the record and have that record show on the main form.
The code I have so far is...
With the name of my form being PersonDetailsForm, the name of the field I am trying to get to being PersonID and the name of the listbox being SearchResults, with the searched PersonID living in the first column (column0) of this list box.
When I run this code and double click on a specified record, I recieve the error "Run-time error '424': Object Required
I don't understand why this happens? Is it because the value is numerical? Any help would be greatly appreciated!
I currently have a list box that filters though a list of records on the main form using a text box.
I have got the search function working, and the list box filters correctly, the problem I am having is that I need to be able to double click the record and have that record show on the main form.
The code I have so far is...
Code:
Private Sub SearchResults_DblClick(Cancel As Integer)
DoCmd.OpenForm "PersonDetailsForm", , , "[PersonID] = '" & Me.[SearchResults].Column(0).Value & "'"
End Sub
With the name of my form being PersonDetailsForm, the name of the field I am trying to get to being PersonID and the name of the listbox being SearchResults, with the searched PersonID living in the first column (column0) of this list box.
When I run this code and double click on a specified record, I recieve the error "Run-time error '424': Object Required
I don't understand why this happens? Is it because the value is numerical? Any help would be greatly appreciated!