C
clk
Hi. I have the following code. What happens is I have a criteria
parameter on the query prompting the user for a date. The parameter
is [Enter Start Date]. What I would like is that parameter included
in the filename when it exports to Excel. Can this be done? It fails
on the line tDate = Me.[Enter Start Date]. Any suggestions are
appreciated.
stDocName = "qryTesting"
FileName = "OrdersEntered"
tDate = Me.[Enter Start Date]
FileDir = "q:\receptionist\daily reports\"
XFile = FileDir & FileName & tDate & " .xls"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.OutputTo acOutputQuery, "qryTesting", _
acFormatXLS, XFile, True
DoCmd.Close acQuery, "qryTesting", acSaveNo
parameter on the query prompting the user for a date. The parameter
is [Enter Start Date]. What I would like is that parameter included
in the filename when it exports to Excel. Can this be done? It fails
on the line tDate = Me.[Enter Start Date]. Any suggestions are
appreciated.
stDocName = "qryTesting"
FileName = "OrdersEntered"
tDate = Me.[Enter Start Date]
FileDir = "q:\receptionist\daily reports\"
XFile = FileDir & FileName & tDate & " .xls"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.OutputTo acOutputQuery, "qryTesting", _
acFormatXLS, XFile, True
DoCmd.Close acQuery, "qryTesting", acSaveNo