I am using Access 2007. In Access 2003, when you had the import window opened and clicked on the Cancel button, MS displayed an error message. To compensate for this using VB code, I used the "On Error" function because I am opening the Import window using VB code. I want to code to do something if the user clicks on the cancel button.
Code:
On Error Goto Opps2
DoCmd.RunCommand acCmdImportAttachText
Msgbox "File Imported! ", vbInformation + vbOkOnly, "BegProcessMsg3"
Opps2:
Msgbox "Import Canceled! ", vbInformation + vbOkOnly, "BegProcessErrMsg2"
Goto End1
End1:
End Function
Question: Does anyone know how to fix this issue. If the Import cancel button no longer generates an error, how do you program a custom message when the cancel button is clicked.