A list box uses the query "Query1" to list data filtered through a search bar, below it is a group of text boxes with the same fields as the query, they are also sourced from the same query.
The idea is to click on the list box when the search has been filtered and it will fill in the boxes below it.
I've tried one method and it failed, this method relies on a companyName being present, which isn't always the case.
I have tried to apply an If statment, and various methods of trying to ask first if CompanyName is present or not but it doesn't seem to work.
The idea is to click on the list box when the search has been filtered and it will fill in the boxes below it.
I've tried one method and it failed, this method relies on a companyName being present, which isn't always the case.
Code:
Private Sub QuickSearch_DblClick(Cancel As Integer)
DoCmd.Requery
Me.RecordsetClone.FindFirst "CompanyName = '" & Me![QuickSearch] & "'"
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
MsgBox "Could not locate [" & Me![QuickSearch] & "]"
End If
End Sub
I have tried to apply an If statment, and various methods of trying to ask first if CompanyName is present or not but it doesn't seem to work.