By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

By Pass Keys

P: n/a
Dear all,

Does anybody know how to disable the bypass key ("SHIFT") which is used at
startup?

Thanks in advance,

Adonis.

Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Adonis,

Paste the following code into a module and then call it via the immediate
window by pressing <Ctrl G>, then typing DisableShiftKeyByPass and pressing
<Enter>. The next time the database is opened the shift key is disabled. To
convert the shift key back to normal change the "False" in
db.Properties("AllowByPassKey") = False to True.

Function DisableShiftKeyByPass() As Boolean
' The next time the database is opened
' after this function is run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
On Error GoTo errDisableShift
Dim db As Database
Dim prop As Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = False
DisableShiftKeyByPass = 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
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function DisableShiftKeyByPass did" & "not complete
successfully."
DisableShiftKeyByPass = False
GoTo exitDisableShift
End If
End Function
"Adonis Walmsley-McCarthy" <aw*******@blueyonder.co.uk> wrote in message
news:4n*****************@news-binary.blueyonder.co.uk...
Dear all,

Does anybody know how to disable the bypass key ("SHIFT") which is used at
startup?

Thanks in advance,

Adonis.

Nov 12 '05 #2

P: n/a

You haven't set the DDL parameter on the CreateProperty method to True.

This means that anybody who can open the database can run code to switch
this off.

Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)

Should be
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False,
True)
Terry

"Stewart Allen" <sa****@ThisPartNotVailid.wave.co.nz> wrote in message
news:bn**********@news.wave.co.nz...
Hi Adonis,

Paste the following code into a module and then call it via the immediate
window by pressing <Ctrl G>, then typing DisableShiftKeyByPass and pressing <Enter>. The next time the database is opened the shift key is disabled. To convert the shift key back to normal change the "False" in
db.Properties("AllowByPassKey") = False to True.

Function DisableShiftKeyByPass() As Boolean
' The next time the database is opened
' after this function is run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
On Error GoTo errDisableShift
Dim db As Database
Dim prop As Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = False
DisableShiftKeyByPass = 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
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function DisableShiftKeyByPass did" & "not complete
successfully."
DisableShiftKeyByPass = False
GoTo exitDisableShift
End If
End Function
"Adonis Walmsley-McCarthy" <aw*******@blueyonder.co.uk> wrote in message
news:4n*****************@news-binary.blueyonder.co.uk...
Dear all,

Does anybody know how to disable the bypass key ("SHIFT") which is used at startup?

Thanks in advance,

Adonis.


Nov 12 '05 #3

P: n/a
Thanks for that Terry. I've just looked at the sample at
http://www.mvps.org/access/general/gen0040.htm and will start using that
code instead.

Stewart
"Terry Kreft" <te*********@mps.co.uk> wrote in message
news:bn**********@newsreaderg1.core.theplanet.net. ..

You haven't set the DDL parameter on the CreateProperty method to True.

This means that anybody who can open the database can run code to switch
this off.

Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)

Should be
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False,
True)
Terry

"Stewart Allen" <sa****@ThisPartNotVailid.wave.co.nz> wrote in message
news:bn**********@news.wave.co.nz...
Hi Adonis,

Paste the following code into a module and then call it via the immediate
window by pressing <Ctrl G>, then typing DisableShiftKeyByPass and pressing
<Enter>. The next time the database is opened the shift key is disabled.

To
convert the shift key back to normal change the "False" in
db.Properties("AllowByPassKey") = False to True.

Function DisableShiftKeyByPass() As Boolean
' The next time the database is opened
' after this function is run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
On Error GoTo errDisableShift
Dim db As Database
Dim prop As Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = False
DisableShiftKeyByPass = 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
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function DisableShiftKeyByPass did" & "not complete
successfully."
DisableShiftKeyByPass = False
GoTo exitDisableShift
End If
End Function
"Adonis Walmsley-McCarthy" <aw*******@blueyonder.co.uk> wrote in message
news:4n*****************@news-binary.blueyonder.co.uk...
Dear all,

Does anybody know how to disable the bypass key ("SHIFT") which is

used at startup?

Thanks in advance,

Adonis.



Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.