Query with wildcard searching for text from control

  • Thread starter Thread starter Anne
  • Start date Start date
A

Anne

Hi All,

Can anyone tell me the correct syntax for preforming the
Like operation with a wildcard where the text to be
searched for comes from a control on a form? I'm trying
this, but it's not working:

SELECT tbl_Employees.Last_Name
FROM tbl_Employees
WHERE (((tbl_Employees.Last_Name) Like "*[Forms]!
[frm_MainEmployee]![txt_SearchEmployee]*"));

Any help appreciated!
 
Hi All,

Can anyone tell me the correct syntax for preforming the
Like operation with a wildcard where the text to be
searched for comes from a control on a form? I'm trying
this, but it's not working:

SELECT tbl_Employees.Last_Name
FROM tbl_Employees
WHERE (((tbl_Employees.Last_Name) Like "*[Forms]!
[frm_MainEmployee]![txt_SearchEmployee]*"));

Any help appreciated!

Like "*" & [Forms]! [frm_MainEmployee]![txt_SearchEmployee] & "*"

will find the entered word anywhere in the field.

The form must be open when the query is run.
 
Back
Top