Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vba filter - help!!! 1

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
586
GB
Hello,

I am trying to filter a form by using the following code following update of a text box:

Private Sub txt_find_contact_AfterUpdate()

Application.Echo False

Me.Form.Filter = "[contact_lookup_ref] like'*" & [txt_find_contact] & "*'" And "[Contact_Active] = True"
Me.FilterOn = True
Me.OrderBy = "[contact_lookup_ref] ASC"
Me.OrderByOn = True
DoCmd.GoToControl "txt_CURSOR_header"
Me.txt_find_contact = Null

Application.Echo True

End Sub


The code worked ok, until I added And "[Contact_Active] = True" to the second line.

I can figure out why it wont work. Thank for any help - Mark
 
Me.Form.Filter = "[contact_lookup_ref] like '*" & [txt_find_contact] & "*' And [Contact_Active] = True"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Moss100,
If it "works a treat", you should click the "Like this post? Star it!" link to award PHV a star and let the rest of us know your question has been answered.


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top