Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running parameter query with variable value

Status
Not open for further replies.

RichyT

Technical User
Jun 11, 2002
20
GB
I wish to run a parameter query from a macro, so that the parameter is passed in from a variable within the macro. Could anyone please help?

Cheers

Rich
 
If you are running an MSquery, I think you will need to extract the SQL staement and build it freehand within the code 'cos if not, all the fields / parameters / criteria etc are contained within the dqy file and therefore not referenced in the macro itself
HTH
Geoff
 
If I do this, will I have to use the 'DoCmd.RunSQL' syntax, and if so, how do I pass the parameter into the string?
 
Aaaaaaaah - sorry - thought you were in excel. Much easier in Access. If the parameter is to be driven by an entry on a form just use formname.controlname.value in the criteria pane in the query and then just run the query as normal.
It very much depends on how you are getting your parameter variable tho
Rgds
Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top