View Single Post
  #2  
Old August 26th, 2004, 03:27 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default

Place an unbound text box on the form that you wish to filter.
Typically this would go into the Form Header section (View menu).
In its AfterUpdate event procedure, set the Filter of the form.

Example:

Private Sub txtFilter_AfterUpdate()
If Me.Dirty Then 'Save before filter
Me.Dirty = False
End If

With Me.txtFilter
If IsNull(.value) then 'nothing entered: show all.
Me.FilterOn = False
Else
Me.Filter = "[SomeField] Like """*" & .Value & "*"""
Me.FilterOn = True
End If
End With
End Sub

Now, as soon as the user enters something, the form filters to just the
matches, and if they clear the entry, it shows all records again.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

wrote in message
...
Instead of using the Enter Parameter Value dialog box
with the below criteria:

Like "*" & [Enter description name for wildcard search:]
& "*"


I would like to use a text box on my frmMainSwitchboard
form:

Like "*" & [Forms]![frmMainSwitchboard]![txtDescript]
& "*"

The above provides all records within in table. If this
is possibe, any assistance you could provide with syntax
would be greatly appreciated.

Chuck B.