Using a Form Field as A Query Criteria

stlryan82

New member
Local time
Today, 14:09
Joined
May 31, 2011
Messages
8
Hello all,

I have a criteria in a query that references an unbound textbox in a form. Basically, I want to be able to enter a keyword in the textbox, and the query returns all records that contain that keyword in that field.

Here's the criteria function I'm using and for some reason it's not working:

Alike "*[Forms].[FormName].[TextBoxName]*"

I tried using "!" instead of a period between brackets and that didn't work either.

When I change the criteria the below, the query works perfectly fine, so I'm assuming I'm making an error in the way I'm referencing the unbound textbox?

Alike "*keyword*"

Thanks in advance for any help.

Ryan
 
*Correction, I'm using "Like" in my functions instead of "Alike" as my original posts states.

Thanks
 
Found the answer as soon as I posted this.

Like "*" & [Forms].[FormName].[TextBoxName] "*"

Sorry to clutter the board.
 

Users who are viewing this thread

Back
Top Bottom