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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I disable the shift key at startup?

Access Howto:

How can I disable the shift key at startup?

by  rhicks  Posted    (Edited  )
How Do I Disable the Shift Key During Startup?

Read All Carefully Before Proceeding!!!!!!!!!

Here is two sub routines. One is to disable the shift key and the other is to re-enable the shift key.
You only need to call the disable code one time and the shift key will remain disabled until you run the Re-enable code.

The main thing to remember is that you need a way to run the Re-enable code from your open app, but you don't want the user to know how to do it. If you don't have a way to re-enable the shift key will have locked yourself out as well. I usually place a small transparent button on a screen that is seldom used by the user. I usually place the button in a corner where I know where it's at. The Re-enable code is called by the On Click event of this transparent button.

To run the disable the shift key code, you do something similar to the above approach or call the sub how ever you wish. The thing to remember is "Have a way to Re-enable the shift key".

Special Note...............
Make a backup of you db before you start.

'********************************************************
'This Code Disables the Shift Key
'
Public Sub DisableByPassKeyProperty()
Dim db As Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prp
End Sub
'********************************************************


'********************************************************
'This Code Re-enables the Shift Key
'
Public Sub EnableByPassKeyProperty()
Dim db As Database
Set db = CurrentDb
db.Properties.Delete "AllowByPassKey"
db.Properties.Refresh
End Sub
'********************************************************

HTH
RDH
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top