Export Query to Excel command code HELP

K

Kaylen

I have some queries which I want to allow the users to be able to export to
Excel and also automatically allow them to save to desired destination (not
the default destination). For example when the user select the parameters
for the query and click OK, the query ran and the Access spreadsheet appears.
I would like to have a program code that when the user click OK, the query
automatically export to Excel and also asked the user to where they want to
save the excel spreadhseet instead of saving to the default folder. Can
someone help me with the code? Where do I place this command code?
 
P

Piet Linden

I have some queries which I want to allow the users to be able to export to
Excel and also automatically allow them to save to desired destination (not
the default destination).  For example when the user select the parameters
for the query and click OK, the query ran and the Access spreadsheet appears.
I would like to have a program code that when the user click OK, the query
automatically export to Excel and also asked the user to where they want to
save the excel spreadhseet instead of saving to the default folder.  Can
someone help me with the code? Where do I place this command code?

TransferSpreadsheet is your friend.
You can pass whatever path you want to it, which will save the file
where you specify.
If you want to specify a location, you can use the OpenSaveFile API on
Access web. www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top