passing a parameter to MSAccess Query

G

Guest

Hi

I have a Update query in MS-Access which when run prompts for a parameter
and then copies data from TableA to a Temp Table.
As I need the Query to run more than once using a macro or code, how do I
pass a parameter once so that if the query runs more than once it does not
keep on asking for the same parameter?

Thanks

Brian
 
N

Nikos Yannacopoulos

Brian,

Make the query read the parameter from a control (textbox?) on a form;
assuming you have a form named MyForm, with a control named MyParameter,
in which the user types (or selects, if it is a combo or list box), then
change the criterion in the query to:

Forms![MyForm]![MyParameter]

As long as the form remains open, the query will "read" the parameter as
many times as required.

HTH,
Nikos
 

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