Creating a textbox in a form to filter a combobox

Pooks_35

Registered User.
Local time
Today, 04:27
Joined
Mar 14, 2013
Messages
54
I have a subform in datasheet view for tracking calls from clients. The Client Name is a combination of the first and last name. I want to create a text box that allows me to start typing in the client name and it will filter for only those Clients that match. Currently, I have the following code (below) for the textbox, however when I start typing in a client name all the clients disappear from the table. The client name is in a combo box so I don't know if that is making a difference. Any help would be appreciated! Thanks.


Private Sub Text3_Change()


Dim strFilter As String

Me.Refresh

strFilter = "Client like '*" & Me.Text3 & "*'"

Forms!frm_ClientContacts!frm_Contactsubform.Form.Filter = strFilter
Forms!frm_ClientContacts!frm_Contactsubform.Form.FilterOn = True

Me.Text3.SelStart = Nz(Len(Me.Text3), 0)

End Sub
 
In the change event you must use the .Text property of the textbox.
 
Thanks! That worked!
 

Users who are viewing this thread

Back
Top Bottom