G
Guest
I am using the below code to export table data from a button on a form to
excell:
Private Sub cmdExport_Click()
On Error GoTo Do_Nothing
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7,
"ExpenseActt", txtExportFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "Vendor",
txtExportFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7,
"VendorInv", txtExportFile
MsgBox "The tables have been successfully exported to " & txtExportFile
& "."
Exit Sub
Do_Nothing:
MsgBox "Export has failed. An error occurred or the user terminated the
operation."
End Sub
Private Sub cmdExport_Enter()
End Sub
Private Sub txtExportFile_BeforeUpdate(Cancel As Integer)
End Sub
It works well on exporting but is there a way to place a parameter of date
that would prompt a user to enter begin date -end date so the whole data base
file is not exported?
excell:
Private Sub cmdExport_Click()
On Error GoTo Do_Nothing
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7,
"ExpenseActt", txtExportFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "Vendor",
txtExportFile
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7,
"VendorInv", txtExportFile
MsgBox "The tables have been successfully exported to " & txtExportFile
& "."
Exit Sub
Do_Nothing:
MsgBox "Export has failed. An error occurred or the user terminated the
operation."
End Sub
Private Sub cmdExport_Enter()
End Sub
Private Sub txtExportFile_BeforeUpdate(Cancel As Integer)
End Sub
It works well on exporting but is there a way to place a parameter of date
that would prompt a user to enter begin date -end date so the whole data base
file is not exported?