A
Aamer
I am using the following code to export Tables
Private Sub Export_Data_Click()
On Error GoTo Export_Data_Err
DoCmd.OutputTo acOutputTable, "Purchases", "ExcelWorkbook(*.xlsx)", "",
False, "", 0, acExportQualityPrint
DoCmd.OutputTo acOutputTable, "Sales", "ExcelWorkbook(*.xlsx)", "",
False, "", 0, acExportQualityPrint
DoCmd.OutputTo acOutputTable, "Company", "ExcelWorkbook(*.xlsx)", "",
False, "", 0, acExportQualityPrint
DoCmd.OutputTo acOutputTable, "Sub Description",
"ExcelWorkbook(*.xlsx)", "", False, "", 0, acExportQualityPrint
Export_Data_Exit:
Exit Sub
Export_Data_Err:
MsgBox Error$
Resume Export_Data_Exit
End Sub
This saves Files in Excel as:
Purchases
Sales
Company
Sub Description
Where as I want it to save as the following:
Purchases With Current Date example Purchase 07 Jan 2010
Sales With Current Date example Purchase 07 Jan 2010
Company With Current Date example Purchase 07 Jan 2010
Sub Description With Current Date example Purchase 07 Jan 2010
Can someone please help me fix the code.
Thanks
Aamer
Private Sub Export_Data_Click()
On Error GoTo Export_Data_Err
DoCmd.OutputTo acOutputTable, "Purchases", "ExcelWorkbook(*.xlsx)", "",
False, "", 0, acExportQualityPrint
DoCmd.OutputTo acOutputTable, "Sales", "ExcelWorkbook(*.xlsx)", "",
False, "", 0, acExportQualityPrint
DoCmd.OutputTo acOutputTable, "Company", "ExcelWorkbook(*.xlsx)", "",
False, "", 0, acExportQualityPrint
DoCmd.OutputTo acOutputTable, "Sub Description",
"ExcelWorkbook(*.xlsx)", "", False, "", 0, acExportQualityPrint
Export_Data_Exit:
Exit Sub
Export_Data_Err:
MsgBox Error$
Resume Export_Data_Exit
End Sub
This saves Files in Excel as:
Purchases
Sales
Company
Sub Description
Where as I want it to save as the following:
Purchases With Current Date example Purchase 07 Jan 2010
Sales With Current Date example Purchase 07 Jan 2010
Company With Current Date example Purchase 07 Jan 2010
Sub Description With Current Date example Purchase 07 Jan 2010
Can someone please help me fix the code.
Thanks
Aamer