• Melbourne
  • Australia

Phone: +61 03 9410 9815

Password Protect MS Access VBA Code

Return to FAQs

Many MS Access developers have asked if it is possible to password protect the VBA code in an Access database they have developed, without  password protecting entire database. The answer is yes!

To password protect the VBA Code in an MS Access Database:

  • Open the MS Access VBA editor (You can press ALT+F11 to open the editor)
  • On the Tools menu, select <Database Name> Properties
  • On the Protection tab, select the ‘Lock project’ for viewing check box. Enter and confirm a password (Make sure to note down the password somewhere securely)
  • Click the OK button, and then close and reopen the database.

When you next go to to view the VBA code, you will be prompted for the password.

You should be aware that there are tools and methods that can be used to remove VBA passwords, so protecting your VBA by using this procedure should not be considered a fool-proof security method. However, it is a very good way to keep most people from accessing or accidentally changing the code.

A more robust method to protect your VBA code, and indeed your entire database, is to compile the database to an .accde or .mde file format. For more information on protecting the VBA code in your database or information on converting your database to a compiled format we recommend you read this Microsoft Office.com article.

Return to FAQs


Subscribe to Newsletter

Get the latest GI Business Database Solution News and be amongst the first to know when we release new or updated Access Database business sample.

Obligation Free Advice

Need a custom Access database for your business but don’t know where to start?

Send us the details and well get back to you to discuss your options. No obligation and it’s free. Contact Us

Database Download… Free!

Why not download and try one of the many Microsoft Access databases available in our download section. Most are FREE to keep and use as long as you like.

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match