General discussion
September 7, 2001 at 04:53 AM
dennisbv

FileName for OutputTo action

by dennisbv . Updated 24 years, 11 months ago

I asked a question about creating a Excel file from Access, The answer I accepted was the Outputto function in Access. What I need to know is can I create a new file with a Name from a stirng in my code. The OutputTo Action works if I put the nameof an Existing File I cannot seem to create a new file.
Here is my syntax
DoCmd.OutputTo acOutputQuery, “qryReport”, acFormatXLS, ” rptTest.xls”, True

I tryed to put in strFileName(the file name I want)in place of rptTest.xls but I recieve the message “Run-Time Error ‘2302’:
Kohlerdatabase can’t save the output data to the file you’ve selected. “

This discussion is locked

All Comments