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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queries and Macros

Status
Not open for further replies.

yamy

Technical User
Nov 22, 2002
54
US
When I use a macro behind a command button to export a report to excel, do i first need to have the macro open the query before output. seems like it would have to be open to be output but not sure - please comment - thanks
yamy
 
No, you don't have to do that. The exporting process will reference the query and export the results for you. You just have to properly setup the Export command with the query as a parameter and the query will run providing the recordset to be exported. Bob Scriver
 
what I really meant to ask, is, will the query always export with latest data? as if it was refreshed every time? that's why i think i had to open and rerun it first.
thnks

 
No, the data will always be the latest. The exporting process executes the designated query, runs it to get the latest data, and then exports the data. Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top