Two forms to run the same query

aian

Registered User.
Local time
Today, 10:10
Joined
Jan 28, 2005
Messages
70
Hi to everyone!

Here's the problem. I have two forms and each one has a button that will run the same search. The search is actually importing criteria in a query. FormA has a button named FINDCLIENT that passes the Cient_ID to the query and runs it. FormB has a button named FINDCLIENTB that does exactly the same function.

In the criteria of the query, under the CLIENT_ID field, I have written the following:
[Forms]![FormA]![CLIENT_ID]
or
[Forms]![FormB]![CLIENT_ID]

When I click on the FormA's button, it passes the value for the CLIENT_ID correctly to the query, but it also asks for the FormB's CLIENT_ID. I just click OK without entering anything in the popup box and it returns the query results correctly. The same happens with the FormB's button, but vice versa, it also asks for the FormA's CLIENT_ID. Again I click OK without entering anything in the popup box and it returns the query results correctly.

Is there a way to prevent access from asking one of the two CLIENT_IDs, depending on which button I click on? Or do I have to put up with the message and simply click on OK everytime?

Thanks in advance for your help

Alexander
 
You could create two copies of the query one linked to one form and one link to the other.
 
I believe there is such a thing as a "parameter query" but I haven't used these myself, but you may find this suitable.
 
Thanks Tony, I'll give it a try. BTW, great website you've got yourself. I became a member last week... :o)
 
Thanks for the compliment Aian its appreciated.

I hope to add more videos when I've got the time.
 

Users who are viewing this thread

Back
Top Bottom