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