Force Re-Enable Shift Key Bypass on an MS Access Database

Let's bust it open!
Written by Jacob, October 2025
Jacob Brown
First, why are you doing this?

Please make good decisions. The information I give here is mainly for fixing your own mistakes or possibly breaking open a passed-down database or something similar.

What is Shift-Enabling?

Trying to break into an MS Access database? Or maybe you accidentally disabled the shift-key bypass on one? Here's how to force re-enable the shift-key bypass. I'm assuming you know what shift-key bypass is for an MS Access Database. Just so we're clear though, it's that "special keys" thing that allows you to bypass the startup form and any startup macros from running. It basically opens a database bypassing all the protective procedures.

Two Methods

You could do this a few ways... Here are two.

  • 1. Use another MS Access Database (or any other MS product)

  • 2. Use a VBScript

The method / code is essentially the same. Both use the core function below. This code sample is basic and is expecting the database to already at least have the property available. The code samples later deal with the possibility of that not existing yet.

Copy to Clipboard
Function enableShift()
  
'initialize variables
Dim db, acc

'specify database location
Dim databaseLocation as String
databaseLocation = "C:\\dev\WorkingDB_brownj_dev.accdb"
  
'open the database as an Access object
Set acc = CreateObject("Access.Application")

'open the "database" now within that object
Set db = acc.DBEngine.OpenDatabase(databaseLocation, False, False)

'run the command
db.Properties("AllowByPassKey") = True

'clear your objects (otherwise you'll have to force-close some tasks)
db.Close
Set db = Nothing
Set acc = Nothing

MsgBox "Done!"

End Function
METHOD 1: Use another MS Access DB

You could also use Excel, PowerPoint, Word, Classic Outlook, etc. It doesn't really matter which application you use. Just a place you can run some VBA. In this function, the error handling uses VBAs "On Error GoTo" functionality.

  • 1. Open the VB Editor.

    (in the other database)

  • 2. Paste the below code into a module.

    Don't forget to modify your DB location!

  • 3. Run the function!

    I usually go to the immediate pane and type the function name, then hit Enter

Copy to Clipboard
Function enableShift()
On Error GoTo errEnableShift

'initialize variables
Dim databaseLocation as String
Dim db As DAO.Database, acc
Dim prop As DAO.Property
Const conPropNotFound = 3270

'specify database location
Dim databaseLocation as String
databaseLocation = "C:\\dev\WorkingDB_brownj_dev.accdb"
  
'open the database as an Access object
Set acc = CreateObject("Access.Application")

'open the "database" now within that object
Set db = acc.DBEngine.OpenDatabase(databaseLocation, False, False)

'run the command
db.Properties("AllowByPassKey") = True

GoTo exitThis

errEnableShift:
If Err = conPropNotFound Then
    Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, True)
    db.Properties.Append prop
    Resume Next
    GoTo exitThis
End If

MsgBox "Done!"

exitThis: 'clear your objects/detach from the database
db.Close
Set db = Nothing
Set acc = Nothing

End Function
METHOD 2: Create a VBScript file

If you've never used one before, VBScripts are very handy. Sometimes I use an MS Access DB to call a VBscript. Sometimes, I use a VBScript to call an MS Access DB. Other times, I'll use it to perform some strange task like this one.

They are very simple to create. Just open a text editor (notepad works just fine). Be careful having this file out in the open though - and then labelling it "how to disable shift protection" or something like that. I think you know what I'm saying here.

VBScripts do not have the ability to use "On Error GoTo" like VBA, so you will need to use a different method, like below.

  • 1. Open a text editor (notepad is the example here)

  • 2. Paste the below code into that file. Don't forget to modify your DB location.

  • 3. Save the file with an extension of .vbs

  • 4. Close the file, and double-click it to run it.

Copy to Clipboard
On Error Resume Next
 
Const conPropNotFound = 3270

'initialize variables
Dim db, acc
Dim prop
 
'specify database location
Dim databaseLocation
databaseLocation = "C:\\dev\WorkingDB_brownj_dev.accdb"
'open the database as an Access object
Set acc = CreateObject("Access.Application")
 
'open the "database" now within that object
Set db = acc.DBEngine.OpenDatabase(databaseLocation, False, False)
 
'run the command
db.Properties("AllowByPassKey") = True
 
'if there is an error, then you need to add the property
If Err = conPropNotFound Then
  Set prop = db.CreateProperty("AllowByPassKey", 1, True)
  db.Properties.Append prop
End If
 
'clear your objects/detach from the database
db.Close
Set db = Nothing
Set acc = Nothing

MsgBox "Done!"
Wow, that's really all there is to it?

Yeah this is a scary reality of developing in MS Access. There are many other security measures you can take, but this common one is pretty easy to break through. In all reality, though, this is still plenty of security unless you know you have some power users that could easily google this and find this very article...

Have a question? See an error?

Contact

Check out our YouTube channel for video tutorials!

VBA Decoded Logo
VBA Decoded

©All Rights Reserved.