Exporting to MS Excel

dcjones

Dereck
Local time
Today, 19:37
Joined
Mar 10, 2004
Messages
108
Hi All,

I have a Form which gets its records from a query.

The query works and shows the correct records on the form, No problem here.

I have a Command Button on the form which when clicked on runs an Event.


DoCmd.TransferSpreadsheet acExport, , "NDTMS_ReturnQueryTEMP", "f:\ley_community\database\ndtms_reports\ndtms.xls"

"NDTMS_ReturnQueryTEMP" is the query behind the Form.
"f:\ley_community\database\ndtms_reports\ndtms.xls" is the excel file I want the data to go into.

Is the Event correct.


Any help please.


Kind Regards, keep safe and well.


Dereck
 
Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "NDTMS_ReturnQueryTEMP", "f:\ley_community\database\ndtms_reports\ndtms.xls", True
HTH
 

Users who are viewing this thread

Back
Top Bottom