By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,164 Members | 969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,164 IT Pros & Developers. It's quick & easy.

Search Multiple Queries with One Entry

P: n/a
I have a form that has 6 command buttons on it. Each command button
runs a different query with a wildcard parameter value that looks in 6
different tables in 6 different linked databases. None of the
databases are joined or have anything in common. Right now the users
have to key in the same lookup string for every button. Is there a way
to have a text box on the form, where the user can key the wildcard
text string and then click on the button and the query would return the
results. Example: I am looking for IBM in each one of the databases.
I would like to type IBM in the text box on the form, when click Search
DBOne and search that database, when just click the next search button
for DBTwo, without retyping IBM everytime. Help I have tryed
everything and I just can't see to get it to work. I am so confused.
Thanks.

May 23 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
one way is to point the queries at the open form to collect the input.
Say you have a textbox, called "txtCriterion" and your form is called
"frmSearch"

Then you could modify your queries so they all look something like
this:

SELECT....
FROM ...
WHERE SomeField=Forms![frmSearch]![txtCriterion]

Then you could make all of the queries run in the click event of a
single button...

DoCmd.OpenQuery "qryMyQuery1"
DoCmd.OpenQuery "qryMyQuery2"

May 23 '06 #2

P: n/a
Thank you so much. I finally got it to work. I have one question, if
my users what the ability to but in partial names, where would I use
the wildcard?

Thanks

pi********@hotmail.com wrote:
one way is to point the queries at the open form to collect the input.
Say you have a textbox, called "txtCriterion" and your form is called
"frmSearch"

Then you could modify your queries so they all look something like
this:

SELECT....
FROM ...
WHERE SomeField=Forms![frmSearch]![txtCriterion]

Then you could make all of the queries run in the click event of a
single button...

DoCmd.OpenQuery "qryMyQuery1"
DoCmd.OpenQuery "qryMyQuery2"


Jun 1 '06 #3

P: 6
Thank you so much. I finally got it to work. I have one question, if
my users what the ability to but in partial names, where would I use
the wildcard?

Thanks

pietlinden@hotmail.com wrote:[color=blue]
> one way is to point the queries at the open form to collect the input.
> Say you have a textbox, called "txtCriterion" and your form is called
> "frmSearch"
>
> Then you could modify your queries so they all look something like
> this:
>
> SELECT....
> FROM ...
> WHERE SomeField=Forms![frmSearch]![txtCriterion]
>
> Then you could make all of the queries run in the click event of a
> single button...
>
> DoCmd.OpenQuery "qryMyQuery1"
> DoCmd.OpenQuery "qryMyQuery2"[/color]
Try this:

SELECT...
FROM...
WHERE SomeField LIKE Forms![frmSearch]![txtCriterion] & "*"
Jun 2 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.