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

Disable Shift Key at Startup

Status
Not open for further replies.

tomcat21

Programmer
Jul 28, 2002
69
US
I found the following code to Disable and Re-Enable the shift key at startup.

To Disable I have:

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



To Re-Enable I have:

Public Sub EnableByPassKeyProperty()
Dim db As Database
Set db = CurrentDb
db.Properties.Delete "AllowByPassKey"
db.Properties.Refresh
End Sub



How do I use this code.
I am trying a command button (On Click) on my Main Switchboard but I can not get it to work.
Could someone give me more details on how to get it to work?


Thanks.


Thomas Bailey
tomcat@reportcop.com
 
I've not tried it yet myself, but try looking at this FAQ:
faq181-143 "How can I disable the shift key at startup?"


Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
I can not get it to work
Any error message ? unexpected behaviour ?
If you want consustent help, ask consistent question.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Speculating here...

Since the shift key is checked while Access is opening the selected database, I believe the author intended his logic to be used where the database is shared. (Versus multiple copies of the front end.)

If that is your configuration, the logic should work. To test it, you'd have to execute the first code segment and then open the same copy a second time while holding the shift key.

As PHV stated, the most useful answers are to specific questions...


HTH,
Bob [morning]
 
You can get the above code to work if you save each one "Enable,Disable" As a seperate module. Then on your buttons ONCLICK code place Call DisableByPassKeyProperty or Call EnableByPassKeyProperty depending on which one you want. Always make a backup and try it on there first!

Christopher Abney
There is no limit to the good you can do if you dont care who gets the credit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top