Tables Exported to Excel for backup

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?
 
P

pietlinden

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top