hi i have a problem with disabling shift key
this is my module code
and when i save this and put two buttom for enable and disabling when i run it comes with an error and the problem is with my code for opening my main menu after login page with runtime error 2501
with this code
this is my module code
Code:
Option Compare Database
Sub DisableShiftKey()
Dim db As DAO.Database
Dim prp As DAO.Property
Set db = CurrentDb
On Error Resume Next
db.Properties.Delete "AllowBypassKey"
On Error GoTo 0
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, False, True)
db.Properties.Append prp
db.Properties.Refresh
Set prp = Nothing
Set db = Nothing
End Sub
Sub EnableShiftKey()
Dim db As DAO.Database
Dim prp As DAO.Property
Set db = CurrentDb
On Error Resume Next
db.Properties.Delete "AllowBypassKey"
On Error GoTo 0
Set prp = db.CreateProperty("AllowBypassKey", dbBoolean, True, True)
db.Properties.Append prp
db.Properties.Refresh
Set prp = Nothing
Set db = Nothing
End Sub
with this code
DoCmd.OpenForm "frmMain"