I am trying to update a form in access 2003 using excel data. I import the data to the form by a command button and this code:
Option Compare Database
On Error GoTo Err_CmdImportExcel_Click
DoCmd.TransferSpreadsheet transfertype:=acImport, tablename:="Test", filename:="C:/Documents and Settings/cmccabe/Desktop/Test.xls", HasFieldNames:=True
Exit_CmdImportExcel_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
However I can not save the event procedure without the following:
Private Sub Command8_Click()
but when I add this to the code i get an undefined expression error and the update does not run. Any suggestions? Thanks.
Option Compare Database
On Error GoTo Err_CmdImportExcel_Click
DoCmd.TransferSpreadsheet transfertype:=acImport, tablename:="Test", filename:="C:/Documents and Settings/cmccabe/Desktop/Test.xls", HasFieldNames:=True
Exit_CmdImportExcel_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
However I can not save the event procedure without the following:
Private Sub Command8_Click()
but when I add this to the code i get an undefined expression error and the update does not run. Any suggestions? Thanks.