passing a parameter to MSAccess Query

B

Brian

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
 
Top