How can I re-enable the Shift key when a user logs in so that the Database window becomes visible?
Answer: Within your Access database, there is a Database Property called "AllowBypassKey". By default, your Access database sets this property to True and allows users to use the Shift key functionality when logging into a secured database.
If you are unable to use the Shift key to bypass the Startup Options and display the Database window, the "AllowBypassKey" property has been set to False and you need to change it back to True.
To do this, you need to run the following VBA code:
Sub EnableShiftKey()You only need to run this code once and your database will re-enable the Shift key from that point on - even if the Access database is shutdown and restarted.
Dim db As DAO.Database
Dim prp As DAO.Property
Set db = CurrentDb
db.Properties.Delete "AllowBypassKey"
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, True, True)
db.Properties.Append prp
db.Properties.Refresh
Set prp = Nothing
Set db = Nothing
End Sub
Just make sure that when you run the code, you have Administrator privileges to the database.
Tip: You may want to create a button on a form that allows you to enable or disable the Shift key. You can make the button visible to only certain users with the CurrentUser function.
If after trying this example, you receive a "not defined" error on the "Dim db as DAO.Database" declaration, you will need to follow some additional instructions.
No comments:
Post a Comment