Wildcard use in QBF Combo Box

G

Guest

I have created a query by form (QBF) that allows the user to select the
parameters for a query from drop down lists. I know how to allow them to
search for the exact value selected from the box, and i was also able to
allow them to search for the value from the box with a wildcard. I did this
by changing the parameters in the query to

[Forms]![FormName]![FieldName]! & "*"

and this worked fine. My question is, how can i make it so the user can
either search for the exact value, or for the value plus the wildcard,
depending on their choice? I tried just leaving the wildcard out of the query
and entering it in the form, but this did not work. Any suggestions?
Thanks so much.
 
A

Allen Browne

Try adding Like to the criteria in the query, i.e.:
Like [Forms]![FormName]![FieldName]
 
G

Guest

Allen- Thanks-
I had tried that already but for some reason it didnt work. Now it does. For
any one else reading this, you need to add "Like" to the parameter in the
query, and then give the user the option of either the exact criteria, and
the criteria + * as two separate choices in the combo box.

Allen Browne said:
Try adding Like to the criteria in the query, i.e.:
Like [Forms]![FormName]![FieldName]

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

jjbf22 said:
I have created a query by form (QBF) that allows the user to select the
parameters for a query from drop down lists. I know how to allow them to
search for the exact value selected from the box, and i was also able to
allow them to search for the value from the box with a wildcard. I did
this
by changing the parameters in the query to

[Forms]![FormName]![FieldName]! & "*"

and this worked fine. My question is, how can i make it so the user can
either search for the exact value, or for the value plus the wildcard,
depending on their choice? I tried just leaving the wildcard out of the
query
and entering it in the form, but this did not work. Any suggestions?
Thanks so much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top