Be kind please. First post.
i'm a rank amateur beginner but I'm slowly learning and enjoying the process. I've been at it for about a month.
I realise this is a very old thread but I've been trying to get this same VBA working and am still getting the same result as aonsu209 was getting.
Namely, the list part of the combo box goes blank.
Judging from the spaces being shown as I enter characters and the list contracts and knowing what is in the relevant table I'd say the search itself is working fine.
Code:
Private Sub SearchCombo_Change()Dim strSQL As String
If Len(Me.SearchCombo.Text) > 0 Then
strSQL = "SELECT CustomerT.Search FROM CustomerT WHERE (((CustomerT.Search) Like '*" & Me.SearchCombo.Text & "*')) ORDER BY CustomerT.Search;"
Else
strSQL = "SELECT CustomerT.Search FROM CustomerT ORDER BY CustomerT.Search;" 'This is the default row source of combo box
End If
Me.SearchCombo.RowSource = strSQL
Me.SearchCombo.Dropdown
End Sub
the Row Source for my combo box is
Code:
SELECT CustomerT.[ClientID], CustomerT.[Search] FROM CustomerT;
The ComboBox name is "SearchCombo"
Table name is CustomerT
I've used a calculated field to combine the columns "FirstName", "PartnersName" & "LastName" into one field called "Search" This is the field that populates the ComboBox
Can anyone please help?
Cheers
Jim