How to export to Excel

D

David Ewer

I have an Access database which contains information on my customers, what
sites they have, and what members of my staff work at those sites.

I want to export some of this data to an Excel spreadsheet. I want to create
a sheet for each site that I manage with a list of every member of staff that
works at that site but I have absolutely no idea how to do this or whether
this is even possible.

Is there anybody that could give me some guidance on this problem?

Thanks

David
 
K

Klatuu

look in help for the TransferSpreadsheet action. Its purpose is to import
and export Excel spreadsheets.
 
S

scubadiver

Put the following in the "click event". This docmd can be repeated as many
times as you like. I have included a string to save the date and time the
file is saved.


Dim sToday As String

sToday = Format(Now, "yyyy.mm.dd hh.mm")

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "QUERY", _
"C:\DESTINATION - " & sToday & ".xls", True, "SHEET NAME"
 
Top