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

Disabling Shift Key

Status
Not open for further replies.

tpearo

Technical User
Apr 24, 2000
124
US
Rick Hicks replied to my request for information on Disabling the Shift Key and pointed me to the frequently asked questions section. There I found a tip on some VB code. I have tried this code several times with no success. I am using Access 2000 should that make a difference. I have made a sample database to test it. Then I type the code for disabling the shift key in the On Load function of a form, and I also put a button on the form that I type the code for re-enabling the ByPassKey at the On Click function.
I keep getting this error "Compile Error - Expected End Sub"
There is an End Sub statement at the bottom of each code. The debugger stops on the apostrophe after the comment line.
What am I doing wrong?
 
This should not be executed from the form's On Load event. As I state in an earlier post, this code only needs to be executed once. Then the property remains in this state until you execute the code to reverse the property. This means everytime the db is opened the shift key will remains disabled each time the db is opened, you don't need to execute the code each time. I would use a transparent button located where the user can not accidently come across it, to initially disable the shift key. I have also emailed you this information. I will also sending you the sample db we used for the test. Maybe this example will help you.
The code given in the FAQ is written for Access 97. I don't use Access 2000, so I had a friend (Jerry Dennison) test the code for Access 2000. There needs to be a reference added to DAO to make this work in Access 2000. The line that needs to be changed is:

Dim db As Database

Change it to:
Dim db As DAO.Database

This needs to be done in both Subs.

HTH
RDH
Ricky Hicks
rdhicks@mindspring.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top