Tables Exported to Excel for backup

  • Thread starter Thread starter Kevbro7189
  • Start date Start date
K

Kevbro7189

I have an Access 2007 D-Base with 6 tables. 3 of the tables I would like to
export to an Excel file, one table on a Sheet. I would like a button on the
Switchboard to accomplish this for me. What would the best way to go about
this?
 
I have an Access 2007 D-Base with 6 tables.  3 of the tables I would like to
export to an Excel file, one table on a Sheet.  I would like a button on the
Switchboard to accomplish this for me. What would the best way to go about
this?

Public Sub ExportToExcel()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"Table1", "C:\Appt.xls", True, "Sheet1"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"Table2", "C:\Appt.xls", True, "Sheet2"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"Table3", "C:\Appt.xls", True, "Sheet3"
End Sub
 
Back
Top