Microsoft Access Office VB VBA Help and Examples

Bypass Startup or Show Hidden Database Forms

If you choose a form in the startup dialog options, you are using an autoexec macro or have disabled the database window and menus,  and you are having problems getting into the database, you can bypass both the startup settings and the autoexec macro by pressing and holding down the shift key while opening the database. Please note if you have password protected the database you will need to press shift again when you click ok on the password dialog box or press enter.

This useful feature is great if you have code during startup that you wish to ignore as it is too slow. But be aware that users can find this option in the access help or may already know it so you should not rely on the startup as a means to lock the database. If you found this web page they probably can as well.

Instead consider giving users an MDE version of the database

And if you've really snookered yourself the following bit of code can always get you out of a mess. Just use it in any other database and change the location to your database.

Private Sub AllowStartup()
Dim dbs As DAO.Database
Set dbs = OpenDatabase("c:\temp\db1.mdb")
dbs.Properties("StartUpShowDBWindow") = False
dbs.Properties("AllowSpecialKeys") = False
Set dbs = Nothing
End Sub
The code and application content of this site is copyright of Smiley I.T. and as such reproduction in any form which is for commercial use requires the permission of the Webmaster. Any use of this code for non-commercial use only requires a link or comment back to the original page you took the code from.