Filter subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top