The AllowBypassKeys is the way to go. One thing you have to be aware of,
however, is that one it is set and you can't use the shift key, you still
need a way in. One way to do it is to create an invisible control somewhere
on one of your forms you can click to allow you in. Another is, if you are
using Access security is to allow a specific group to get into development
mode. Then check during startup to see whether to disable or enable the
bypass key. In the example below, we used our own security and only someone
with the password for the DEV user could get in.
The way it works here is that if DEV wants to get into development mode, he
has to first log on through security with the correct user name (DEV) and
password. Once the code below has executed, the shift key is enabled. He
then has to log out and open the database again using the shift key. When
any other user logs in, the shift key is disabled and all future logins will
have it disabled. The trick here is that if you go into dev mode to do
maintenance, before you distribute your changes, be sure to log in as any
other user so the shift key will be disabled for the next log in.
If Me.txtname = "DEV" Then
ChangeProperty "AllowBypassKey", 1, True
Else
ChangeProperty "AllowBypassKey", 1, False
End If
Here is a function that changes the property. If the property does not
exist, the error handler creates it.
Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function