Blocking display of VBA codes

gear

Registered User.
Local time
Today, 07:02
Joined
Mar 10, 2007
Messages
112
I am asking this out of curiosity. Is there a way to block the appearance of Visual Basic Editor? Whenever there is some mismatch or error in the operation of Access DB, the VB Editor displays the codes with ‘End’, ‘Debug’ & ‘Cancel’ options. What I feel is that inexperienced users may fiddle with the codes which will in turn corrupt the DB. In order to prevent that, can we do something to prevent the VB codes being displayed?
 
You put in an error handler into your events. For example:
Code:
On Error GoTo err_handler

<<<The event code goes here>>>

Exit Sub

err_handler:
   MsgBox Err.Description, vbExclamation, "Error Number: " & Err.Number
   Resume Next
End Sub
 
Dear Bob
You mean I need to put this error handler for each event?
 
Yep, each event that could have a runtime error, you would want to do that. For an easy way to add them, look into downloading MZ-Tools for VBA (http://www.mztools.com) as you can configure a standard error handler and then just put your cursor in the event and click the button and it will add it for you.
 

Users who are viewing this thread

Back
Top Bottom