Filter subform

D

David

Hello,

On my form I have a subform that shows data based off an unbound textbox.
The data in the text box has to be exact to be able to have the data show in
the subform. Is their away to have this a wildcard. So if I entered Dav;
David, Davis, Davids, etc would show up?

Thank You
David
 
A

Allen Browne

David, instead of a subform, you could just put the unbound text box
directly on the form itself, and use its AfterUpdate event to filter your
form.

This kind of thing:

Private Sub txtFilterFirstName_AfterUpdate()
Dim strWhere As String

If Me.Dirty Then Me.Dirty = False 'Save first.

If IsNull(Me.txtFilterFirstName) Then 'Show all
Me.FilterOn = False
Else
strWhere = "[Firstname] Like """ & Me.txtFilterFirstName & "*"""
'Debug.Print strWhere
Me.Filter = strWhere
Me.FiltrerOn = True
End If
End Sub
 
Top