Disable VBA window in Access Database

I have an access database being deployed to some users.  They use full run Access, and I have locked down the Current Database settings such as Nav Bar, Developers Toolbar, etc.  I have also added code for the AllowBypasskey Property so they can't use the Shift key.

Everything is perfect.  Except.... There is a TON of code in this database.  If they hit an error that hasn't been trapped, they get the "End" or "Debug" window, and it takes them to the VBA window with the error highlighted. How can I prevent them from ever getting to this window?

Who is Participating?
Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
If you need to add Error handling to your database, you might consider using the free MZ Tools, which can do this for you automatically:


This is an addin for the VBA IDE, and is a great product (and it's free).
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:

  Not sure how this got in "anti-spyware", but the answer is to distribute your DB in the MDE format.

 This strips out all the source code so they won't be able to view anything.

Rey Obrero (Capricorn1)Commented:
one way is to password protect the vba code
tools > dbName properties > protection
Jeffrey CoachmanMIS LiasonCommented:
1. You should have error handling in all of your subs.
This way they never get the "Debug/End" Option.

2. Distribute your Database as an MDE/ACCDE file instead of a database file.
This way there is no code to view...
sharpapproachAuthor Commented:
Cool Utility Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.