I have also tried the populate the above cbo using an unbound txtSearchForm to type the wildcard search criteria. Using the code below no value being typed in is returned. So a blank MsgBox opens each time I type in a character.
Code:
Private Sub txtSearchForm_Change()
Dim strSQL_Comp As String
MsgBox Me.txtSearchForm
Me.txtSearchForm.SetFocus
Me.txtSearchForm.SelStart = Len(Me.txtSearchForm.Value) + 1
strSQL_Comp = "SELECT tblComp.[CompID], tblComp.[CompName] FROM [tblClients/Prospects] tblComp " & _
"WHERE [CompName] LIKE '*" & Me.txtSearchForm & "*' " & _
"ORDER BY CompName"
strSQL_Contact = "SELECT [qryCompanyContacts].[ContactID], [qryCompanyContacts].[ContactName], [qryCompanyContacts].[Title], [qryCompanyContacts].[Div/Dept] " & _
"FROM [qryCompanyContacts] " & _
strWhere = ""
Me.cboSelectCompany.RowSource = strSQL_Comp
Me.txtSearchForm.SetFocus
Me.txtSearchForm.SelStart = Len(Me.txtSearchForm.Value) + 1
'Me.cboSelectCompany.Requery
Debug.Print strSQL_Comp
End Sub
This is what the SQL looks like no matter what I type into txtSearchForm, this statement is returned each time I type a character.
SELECT tblComp.[CompID], tblComp.[CompName] FROM [tblClients/Prospects] tblComp WHERE [CompName] LIKE '**' ORDER BY CompName