To set the AllowBypassKey property to False, follow these
steps:
Start Access.
Open an Access database project.
In the Database window, point to Macro on the Tools menu,
and then click Visual Basic Editor.
In the Visual Basic Editor, click Immediate Window on the
View menu.
Type the following code or paste the following code in the
Immediate window, and then press
ENTER.CurrentProject.Properties.Add "AllowBypassKey", False
Close the Visual Basic Editor, and then close the Access
database project.
Open the Access database project. Try to bypass the
startup options that are set for the Access database
project by holding down the SHIFT key while you open the
Access database project.
The functionality of the SHIFT key that permits you to
bypass the startup option is disabled. Although you hold
down the SHIFT key to bypass the startup options, the
startup options are executed. You cannot bypass the
startup options.
............................................
OR
Create form with to command buttons
1st. ShowDatabase
with following code:
Private Sub ShowDatabase_Click()
CurrentDb.Properties("AllowBypassKey") = True
End Sub
2nd. HideDatabase
Private Sub HideDatabase_Click()
CurrentDb.Properties("AllowBypassKey") = False
End Sub
Both of these are as you can see on click events.
And then assign security to this form so only
administrator would have rights to it. And then place it
on switchboard. This way you can toggle between hiding database window and showing it as you please. That way if
you are not running full menus in db you can still make changes later and you are not locked out. Thanks to Amir for this.
Please post back if you have any more problems or questions.