I have a form where users enter the data, a query does some calculations in the background and then they can click on a button to export a report into a text form – this is required as the data requires being in a specific format for printing.
Is there a way of putting a date/timestamp in the name of the file that has been exported? (At the moment the files is called ManualReq.txt, and I would like it to be ManualReq_20080414_1500.txt i.e. 14th April 2008 a15:00)
Private Sub Export_to_Text_Click()
On Error GoTo Err_Export_to_Text_Click
Dim stDocName As String
stDocName = "ManualReq"
DoCmd.OutputTo acReport, "ManualReq", acFormatTXT, "X:\Printer1423\Printer_Queue1\ManualReq.txt", True
Exit_Export_to_Text_Click:
Exit Sub
Err_Export_to_Text_Click:
MsgBox Err.Description
Resume Exit_Export_to_Text_Click
End Sub
Is there a way of putting a date/timestamp in the name of the file that has been exported? (At the moment the files is called ManualReq.txt, and I would like it to be ManualReq_20080414_1500.txt i.e. 14th April 2008 a15:00)
Private Sub Export_to_Text_Click()
On Error GoTo Err_Export_to_Text_Click
Dim stDocName As String
stDocName = "ManualReq"
DoCmd.OutputTo acReport, "ManualReq", acFormatTXT, "X:\Printer1423\Printer_Queue1\ManualReq.txt", True
Exit_Export_to_Text_Click:
Exit Sub
Err_Export_to_Text_Click:
MsgBox Err.Description
Resume Exit_Export_to_Text_Click
End Sub