Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable the Shift Key

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Can anyone tell me how to disable the shift key startup bypass in AccessXP.

Thanks
 
wayne,

try this, be sure to back up your file..make an autoexec macro then in action action choose Runcode and call the faq_DisableShiftKeyBypass() function

Function faq_DisableShiftKeyBypass() As Boolean
Dim strDBName As String, fAllow As Boolean
On Error GoTo errDisableShift

Dim ws As Workspace
Dim db As Database
Dim prop As Variant
Const conPropNotFound = 3270

Set ws = DBEngine.Workspaces(0)
'Set db = ws.OpenDatabase(strDBName)
Set db = CurrentDb
db.Properties("AllowByPassKey") = False
faq_DisableShiftKeyBypass = False
exitDisableShift:
Exit Function

errDisableShift:
'The AllowBypassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.

If Err = conPropNotFound Then
' You must set the fourth DDL parameter to True
' to ensure that only administrators
' can modify it later. If it was created wrongly, then
' delete it and re-create it correctly.
Set prop = db.CreateProperty("AllowByPassKey", _
dbBoolean, False, True)
db.Properties.Append prop
Resume
Else
MsgBox "Function DisableShiftKeyBypass did not complete successfully."
faq_DisableShiftKeyBypass = False
GoTo exitDisableShift
End If
End Function

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


the code below is to enable Shift Key on Start Up...



Function faq_EnableShiftKeyBypass() As Boolean
Dim strDBName As String, fAllow As Boolean
On Error GoTo errDisableShift

Dim ws As Workspace
Dim db As Database
Dim prop As Variant
Const conPropNotFound = 3270

Set ws = DBEngine.Workspaces(0)
'Set db = ws.OpenDatabase(strDBName)
Set db = CurrentDb
db.Properties("AllowByPassKey") = True
faq_EnableShiftKeyBypass = True
exitDisableShift:
Exit Function

errDisableShift:
'The AllowBypassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.

If Err = conPropNotFound Then
' You must set the fourth DDL parameter to True
' to ensure that only administrators
' can modify it later. If it was created wrongly, then
' delete it and re-create it correctly.
Set prop = db.CreateProperty("AllowByPassKey", _
dbBoolean, False, True)
db.Properties.Append prop
Resume
Else
MsgBox "Function DisableShiftKeyBypass did not complete successfully."
faq_EnableShiftKeyBypass = False
GoTo exitDisableShift
End If
End Function
 
Have tried and receive

User defined type not defined on these lines.

Dim ws As Workspace
Dim db As Database
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top