Passing Parameters to Query via Code

rich.barry

Registered User.
Local time
Today, 13:29
Joined
Aug 19, 2001
Messages
176
I have a number of queries, usually opened via a form which contains parameters the query uses.

Is there a means by which I can pass the parameters to the query while opening it with DoCmd.OpenQuery?

Thanks

Richard
 
Well you can use the DoCmd.RunSql("SQL Code " & txtBox.Value & " SQL Code " & variables & ";"

You can reference text boxes or variables declared in your module in VBA hope this gives you some ideas....

Regards,
Brian
 

Users who are viewing this thread

Back
Top Bottom