How to prevent macro from generating error if fails ...

joe789

Registered User.
Local time
Today, 20:27
Joined
Mar 22, 2001
Messages
154
Hi Folks,

I have some code being called from a AutoExec macro. The problem is, that code has some connection strings in it, so if the AutoExec fails, I don't want the traditional 'Macro Single Step' error being flashed on the screen to the user because it has the 'Arguments:' of the code inside of it ... I would rather simply just have a Msgbox saying "Error". An example of what occurs automatically when the code fails is displayed below, is there a way to overwrite this error and make it a MsgBox because I don't want folks to see the connection string in the 'Arguments' section? I am trying to prevent folks from getting to see sensative data displayed in the Arguments section of the error if the macro fails.

Thank you,

Joe
 

Attachments

  • warning.JPG
    warning.JPG
    34.6 KB · Views: 225
test first if CurrentProject.IsTrusted = True.
 

Users who are viewing this thread

Back
Top Bottom