D
DB
I would like to prevent users from overriding my startup
settings by pressing the shift key while opening a
database. I've been reading some of the other posts in
this Newsgroup and have found that this is done by
setting the AllowBypassKey property to false. I've seen
the code located here:
http://www.mvps.org/access/general/gen0040.htm
and I have the following code which I found in a book:
Sub KeepEmOut()
Dim db As Database
Dim pty As Property
On Error GoTo KeepEmOut_Err
Set db = CurrentDb
db.Properties("AllowBypassKey").Value = False
KeepEmOut_Exit
Exit Sub
KeepEmOut_Err:
If Err.Number = 3270 Then 'Error code for "Property
not fount"...
'so we'll create it ourselves
Set pty = db.CreateProperty("AllowBypassKey", dbBoolen,
False)
Else
MsgBox Err.Description
Resume KeepEmOut_Exit
End If
End Sub
My problem is I'm not sure how to use the code to set the
property. I've tried copying it into a module, but then
I wasn't sure how to use the module. I used the help
function in Access to lookup AllowBypassKey, but I didn't
understand the explanation it gave.
Can anyone tell me how to use the code?
Thanks in advance for any help. Please try to dumb down
any responses for me as much as possible. Thanks again.
settings by pressing the shift key while opening a
database. I've been reading some of the other posts in
this Newsgroup and have found that this is done by
setting the AllowBypassKey property to false. I've seen
the code located here:
http://www.mvps.org/access/general/gen0040.htm
and I have the following code which I found in a book:
Sub KeepEmOut()
Dim db As Database
Dim pty As Property
On Error GoTo KeepEmOut_Err
Set db = CurrentDb
db.Properties("AllowBypassKey").Value = False
KeepEmOut_Exit
Exit Sub
KeepEmOut_Err:
If Err.Number = 3270 Then 'Error code for "Property
not fount"...
'so we'll create it ourselves
Set pty = db.CreateProperty("AllowBypassKey", dbBoolen,
False)
Else
MsgBox Err.Description
Resume KeepEmOut_Exit
End If
End Sub
My problem is I'm not sure how to use the code to set the
property. I've tried copying it into a module, but then
I wasn't sure how to use the module. I used the help
function in Access to lookup AllowBypassKey, but I didn't
understand the explanation it gave.
Can anyone tell me how to use the code?
Thanks in advance for any help. Please try to dumb down
any responses for me as much as possible. Thanks again.