I created a unbound combo box using the access wizard in order to filter a form based on what is selected in the combo box. The rowsource of the combobox is SELECT LeadID, CompanyName FROM tbl_Leads_Main ORDER BY CompanyName. I want the combo box to display only the CompanyName. The problem is some records will have the CompanyName field with a null value or with a value of "Confidential". When this happens the code stops at the "If Not rs.EOF then Me.Bookmark = rs.Bookmark. I am sure that it does not know what to do since we have several records where the CompanyName has the same value and does not know which one to pick.
How can I make this search for
SSearch = (LeadID = LeadID and CompanyName = CompanyName)
rs.find = sSearch
This is the code how it is now.
Private Sub Combo581_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.Find "[LeadID] = " & Str(Nz(Me![Combo581], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
How can I make this search for
SSearch = (LeadID = LeadID and CompanyName = CompanyName)
rs.find = sSearch
This is the code how it is now.
Private Sub Combo581_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.Find "[LeadID] = " & Str(Nz(Me![Combo581], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub