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!

Bypass shift key

Status
Not open for further replies.

owens2k

Technical User
Feb 10, 2003
18
GB
Does anybody know how i can make my database so that even if shift is held when it is opened the database window is not shown?
 
Hi

Yes, set the allowbypass proeprty of teh databse to false, but you will have to do more than that since savvy user can just press F11 to see db window, you need to also disable the F11 key

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
create a splash screen.
put two buttons on the screen name them "Lock" and "Unlocked"
in the code for the unlock button put this code in the on click event:-

================================
Private Sub Command23_Click()
Dim db As Database
Set db = CurrentDb
db.Properties.Delete "AllowByPassKey"
MsgBox "Access!", vbExclamation
db.Properties.Refresh
End Sub
================================

in the code for the lock button put this code in the on click event:-

================================
Private Sub Command22_Click()
Dim db As Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("AllowByPassKey", dbBoolean, False)
MsgBox "No Access!", vbExclamation
db.Properties.Append prp
End Sub
================================

now set the buttons in a place only you know about and set there visible property to false.
that only you will know where they are.

Be ALERT - Your country needs Lerts
 
i get the error "user defined type not defined"
and the text "db As Database" in my code gets selected
 
Send me your email address and I will send you a cool little appilcation I wrote to lock down and unlock your database.
Then you can check out the source code you see how I did it.

I have it for Acc97 and Acc2000

curlanlj@yahoo.com
 
i added the referance now i get type missmatch.
 
that works perfectly for me in 97.
what are you using?

Be ALERT - Your country needs Lerts
 
Hi

You are clearly using a version Access later than Access97, and presumably you have ADO and DAO libraries in your list of references. Some object names are common between these two libraries, it is therfore wise to qualify Dim's with library name so

Dim db as DAO.Database
Dim prp as DAO.Property

etc etc

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
HI

I know this is really old but I can't get my command buttons to work when they aren't visible - why is that? Note that the code is fine if I create a form and run it from a command button but that form is never used again and is unbound. Of course this means I can only lock it and not unlock it.

Shelby
 
Hi

" I can't get my command buttons to work when they aren't visible "

how is user supposed to click on them if they are not visible?

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Great info on AllowByPassKey property, but how do you disable F11 Key for reference? tia,

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top