Series of Parameter Queries in Macro

B

bmalak

I have several queries that have a parameter for the filter criteria, all
with the same parameter prompt and required values.

For example, each query contains the same field with the value [AE Name] in
the filter row.

I want to open several of these queries at the same time, but only have to
enter the value for the [AE Name] parameter prompt once. I created a macro
with "OpenQuery" for each of these to run/open sequentially.

However, when executing, each time the subsequent query runs, I have to re-
enter the value for the same parameter prompt.

Can I somehow enter only once and "store" this parameter prompt input to be
the value for all the subsequent queries? (There are eleven queries I run
and it's a bit of a drag to enter/paste in the same value, particularly since
some of the queries run for a long time and I have to wait.)

Gracias for any suggestions.

P.S., I created an unbound form to open first and entered the value in a text
box. I put the form name and text box name in the query criteria and leave
the form open, but it doesn't seem to "pull" this value. I changed the
criteria for the query entry to... Like [Form1]![AE_Name] & "*" where the
form is called Form1 and the name of the unbound text box is "AE_Name" ...
original, huh? :) Still doesn't work...
 
K

Ken Snell \(MVP\)

You have stated the correct approach -- use a form that remains open the
entire time while the queries are being run, and have the value you want to
use be in a control on that form. The expression you posted is the correct
one to use, with one change:

Like [Forms]![Form1]![AE_Name] & "*"
 
B

bmalak via AccessMonster.com

Thank you for the verification.

I finally got this to work.

I corrected the syntax.

It wasn't working by merely typing a value in the input text box and
executing the queries. It seems that the text box still had "focus" and the
query wouldn't pick up this value.

I created a button on the form that then opens a macro with all the parameter
queries. Works like a charm. I also put a "cancel" button on the form and
in the macro included a step to close the form after all the queries executed.


You probably already know this, but in case someone else needs this
information.

You have stated the correct approach -- use a form that remains open the
entire time while the queries are being run, and have the value you want to
use be in a control on that form. The expression you posted is the correct
one to use, with one change:

Like [Forms]![Form1]![AE_Name] & "*"
I have several queries that have a parameter for the filter criteria, all
with the same parameter prompt and required values.
[quoted text clipped - 31 lines]
...
original, huh? :) Still doesn't work...
 

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