How can you generate an Excel file from a query that has parameter

  • Thread starter Thread starter mr3316a
  • Start date Start date
M

mr3316a

In Access 2007, I am currently using the following code to generate an excel
file from a normal select query and it work fine.
In my code, I am building parts of the statement based on data that is
stored in tables.
"s" = a string that represents the name of the query
"p" = a concatenated string that represents the files Path, files Name,
and files extention

DoCmd.OutputTo acOutputQuery, s, acFormatXLS, p, False

My question is what would the code be if the query needed to have parameters
passed in?

Can anyone help me with this?
 
Thanks for your help!
I found you app very interesting, and it gave me a lot of ideas, in
particular instead of gerneration mulipule spreadsheets that I would have to
then create attachments to an e-mail, create 1 spreadsheet with multiples
tabs 1 for each report. Then only have 1 attachment.
Thanks again
Mark
 
Back
Top