All..I'm trying to export a query with date:
This works fine but I would like the time on the export file in case the users need to export multiple files...when I add Format(Time, "HH:MM:SS") & ".xls" it doesn't work unless I take the colons out...help pls
Code:
Private Sub cmdExport Dim qryname as String Dim theFilepath as String qryname= "qryExport" theFilepath = "C:\Users\" & Environ("UserName") & "\Desktop\" theFilePath = theFilePath & qryname & "_" & Format(Date, "yyyy-mm-dd") & ".xls" Docmd.OutputTo acOutput, qryname, acFormatXLS, theFilePath, True