code in form is not running (1 Viewer)

wgma

Registered User.
Local time
Yesterday, 21:42
Joined
Nov 19, 2007
Messages
72
I have a very simple form that has one button. All I want it to do is export some data. Here is the code that I have:

Private Sub Command3_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "qyrEmployeeExport", "c:\EmployeeExport.xls"

End Sub
Private Sub Form_Load()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "qyrEmployeeExport", "c:\EmployeeExport.xls"
End Sub

I have put the code in 2 places just to see if it was reaching it but in both cases the execution would never break.

How can I get the code to be executed?

I am using MS Access 2007.

Thanks.

BTW, I don't know which type of button to use so I canceled the wizard and left the button on the form.
 

wgma

Registered User.
Local time
Yesterday, 21:42
Joined
Nov 19, 2007
Messages
72
Thanks for the help
 

Users who are viewing this thread

Top Bottom