Lapchien
asked on
Wildcard on form filter?
How can this code be amended so that the user can filter on wilcards?
DoCmd.OpenForm "frmEngView", , , "[Surname] = '" & txtEngSurname & "'"
Thanks
Lapchien
DoCmd.OpenForm "frmEngView", , , "[Surname] = '" & txtEngSurname & "'"
Thanks
Lapchien
ASKER
Does not work - I alrady tried that - if the full surname is Mearing and I enter mear I get no results returned...
ASKER
If I add my own * at the end of the filter it works though - do I add it at the end of the code?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Something like that yes - but your example doesn't work :(
:(
ok hold tight. I'll pull some old code.
ok hold tight. I'll pull some old code.
put the wildcards in
I think Datrias was almost there
DoCmd.OpenForm "frmEngView", , , "[Surname] = '*" & txtEngSurname & "*'"
I think Datrias was almost there
DoCmd.OpenForm "frmEngView", , , "[Surname] = '*" & txtEngSurname & "*'"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would try appending asterisks before and after the query part, in the code itself..
DoCmd.OpenForm "frmEngView", , , "[Surname] like '*" & txtEngSurname & "*'"
But then again, that's a completely random thought.. Oh well, try it. ;)
DoCmd.OpenForm "frmEngView", , , "[Surname] like '*" & txtEngSurname & "*'"
But then again, that's a completely random thought.. Oh well, try it. ;)
try
DoCmd.OpenForm "frmEngView", , , "[Surname] like '" & txtEngSurname & "'"