Export to excel with variable filename

goldenvision

Registered User.
Local time
Today, 22:37
Joined
Oct 22, 2003
Messages
49
Various posts on here seem to have flirted with the answer I am looking ofr but I can't seem to find anything specific. Any help would be appreciated.

I am looking to export a paramatised query to excel with a variable file name.

i.e. H:\Projects\CrosstabExport - [paramater value].xls

The threads dealing with adding a date to a file name seem to hint that this is possible but I'm not sure how to go about it.

Thanks in advance.
 
You can use a variation of the following:


MyValue = InputBox("Enter file name:", "InputBox Demo")
tOutputPath = "C:/data/"


DoCmd.OutputTo acQuery, "selAMShortages", acFormatXLS, tOutputPath & MyValue


???
ken
 
Ken,
Thanks very much.

This isn't what I was looking for but it has given me another alternative.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom