One Parameter Form for Several Queries..issue

msk7777

Registered User.
Local time
Today, 12:10
Joined
Jul 17, 2009
Messages
78
Hello everyone,

I have been searching this forum as well as several others for a solution to my problem. I have always used parameter forms for inputing query/report criteria. However, they have always been for one query or report.

However, all searches I have done for trying to use one form for several queries all I find is a simple response of "Create a form and then direct all the queries to grab the parameter from the form.". Sounds simple enough but I can never get it to work.

I have created a macro that runs 12 Append queries. I have also created a parameter form that has an unbound combo box. The combo box is fed by a query that gathers all the Data Dates for the user to select from. So if there are 24 different data dates then the combo box displays them all.

I tried creating a macro that first opens the form then opens the query, however, it runs the query before I can finish entering the criteria in the form. Then I just get a pop up of "You are about to append 0 records...".

I have found several walk-throughs for having a query use a form to grab parameter, but have not been able to find one that shows you how to set up one form to run several queries.

I keep trying to find an answer, I will spend 2-3 hours searching through several forums, find nothing to help me, then give up and continue manually entering 12 dates for 12 queries when they pop up after running the macro. Now I need to create a macro that runs 24 queries and I don't want to have to go through 24 parameter pop-ups.

If anyone can advise me on where I can find either a walk through or a posting that shows how to do this I would be so greatful.

Thanks in advance!
 
I would have a button on the form to allow the user to click on after making a selection. An alternative would be to open the form using acDialog in the window mode argument, which will stop the code in the first form until the criteria form is closed or hidden (in this case you'd want to hide it so it's still available for the queries).
 
pbaldy - Thank you so much for your quick response. That makes sense, however, I have no clue on how to go about applying your suggestions. This is why I was hoping for more of a walk-through.

I am not going to ask anyone to stop their day and write one for me, I was just hoping someone knew of similar instructions already written out.
 
Simplest is probably to take the queries out of the existing macro so it just opens the parameter form. Then add a button to the parameter form and put a macro there that runs the queries. You can probably copy the macro and modify the 2 copies rather than create a new one from scratch. I don't use macros, so don't quotes me on that.
 
pbaldy,

Thank you so much! Your suggestion worked like a charm. Guess I was too close to the problem to think of such a simple, yet genius, solution. Thank you so much for your help!

msk7777
 

Users who are viewing this thread

Back
Top Bottom