Disable By pass Shift Key

V

Vince

Hello,

I know there has been an infinite amount of info
regarding 'DISABLING SHIFT ' Key but I have tried them
all. I am using Access 97 running on NT currently and
would like to disable the shift key to not allow users to
by pass security!!

Do I have to have Visual Basic? I don't want to affect
the OS only for MS Access.

I am not a programmer so any help in detail is MUCH
APPRECIATED!

Thank You,

Vince
 
J

Joan Wild

Vince said:
Hello,

I know there has been an infinite amount of info
regarding 'DISABLING SHIFT ' Key but I have tried them
all. I am using Access 97 running on NT currently and
would like to disable the shift key to not allow users to
by pass security!!

Do I have to have Visual Basic? I don't want to affect
the OS only for MS Access.

I am not a programmer so any help in detail is MUCH
APPRECIATED!

Thank You,

Vince

You'll have to use VBA to do this.

Copy your database.


Make sure you are in the main database window. Click the "modules" tab, then
select "new." Alternatively, you can open an existing module if you have
one.

Copy/paste the following function into it. Save the module giving it some
name other than DisableShiftKeyBypass.

**start**

Function DisableShiftKeyBypass() As Boolean
On Error GoTo errDisableShift

Dim db As Database
Dim prop As Property

Set db = CurrentDb()

On Error Resume Next
db.Properties.Delete "AllowByPassKey"
On Error GoTo errDisableShift

Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False, True)
db.Properties.Append prop
DisableShiftKeyBypass = True

exitDisableShift:
Set prop = Nothing
Set db = Nothing
Exit Function

errDisableShift:
MsgBox "Function DisableShiftKeyBypass did not complete successfully."
DisableShiftKeyBypass = False
Resume exitDisableShift

End Function

***end***

Click on Debug, Compile, and then close the module saving it.

At the database window, hit Ctrl-G which will open the debug window.

Type DisableShiftKeyBypass() and hit enter.

The next time you open the db, the shift will be disabled.

You only need to run the sub once to set the property and then it is set.
It isn't something you would run repeatedly as it isn't necessary.

You can go back to that copy you made in step 1 (which you'll keep in a safe
place) when you want to make changes, or you can use another database to
set the prop back on this database.
 
G

Guest

Thanks Joan!! :)
-----Original Message-----


You'll have to use VBA to do this.

Copy your database.


Make sure you are in the main database window. Click the "modules" tab, then
select "new." Alternatively, you can open an existing module if you have
one.

Copy/paste the following function into it. Save the module giving it some
name other than DisableShiftKeyBypass.

**start**

Function DisableShiftKeyBypass() As Boolean
On Error GoTo errDisableShift

Dim db As Database
Dim prop As Property

Set db = CurrentDb()

On Error Resume Next
db.Properties.Delete "AllowByPassKey"
On Error GoTo errDisableShift

Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False, True)
db.Properties.Append prop
DisableShiftKeyBypass = True

exitDisableShift:
Set prop = Nothing
Set db = Nothing
Exit Function

errDisableShift:
MsgBox "Function DisableShiftKeyBypass did not complete successfully."
DisableShiftKeyBypass = False
Resume exitDisableShift

End Function

***end***

Click on Debug, Compile, and then close the module saving it.

At the database window, hit Ctrl-G which will open the debug window.

Type DisableShiftKeyBypass() and hit enter.

The next time you open the db, the shift will be disabled.

You only need to run the sub once to set the property and then it is set.
It isn't something you would run repeatedly as it isn't necessary.

You can go back to that copy you made in step 1 (which you'll keep in a safe
place) when you want to make changes, or you can use another database to
set the prop back on this database.


--
Joan Wild
Microsoft Access MVP


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top