Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Query in a Union Query?

Status
Not open for further replies.

lostris

Technical User
Oct 9, 2002
6
US
Ok.. just one last question and this report is done - I swear I'm not going through this again heehe

I have a union query bringing together 7 different queries.. I need the union query to be set up so that when I run the report it prompts the user for the month or dates or whatever.. I can do it easily in regular queries.. but not a union query.. is it possible to put a parameter query in a union query? if not.. how the blue hell do I do this?
 
I would suggest using a VBA module to do the following:

1. Prompt users for parameters (probably using InputBox functionality, although you'll have to remember that cancelling an InputBox returns a zero-length string and so needs appropriate error-handling)

2. Take the user-entered values and build the UNION SQL on the fly.

3. Run the UNION SQL.

Hope this helps.
[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top