IF disabled shift Key

Jackpotgee

Registered User.
Local time
Today, 21:13
Joined
Jun 7, 2007
Messages
27
Hi,
I have implemented GHudsons Enabling/Disabling Shift Key code into my database.

http://www.access-programmers.co.uk/forums/showthread.php?t=36043&highlight=bypass+shift

This works great and i now have the ability to enable/disable the shift key to protect the database.

However, when the database close's, if the programmer has not disabled the shift key again then the database will be left unprotected.

I want an IF statement attached to the close Db button, saying If the shift key is enabled then open a warning form, otherwise close the database.

I am not the greatest programmer and so far all of my attempts have failed as i can not get my If statement to referrence the appropriate part of GHudsons code.

Could anyone help me on this?

Thanks in advance
 
Use the unload event of your form. If you use a switchboard, that's the place to put it in.
 
Thanks, but do you have any idea of the code i need for the If statement? Have tried numerous times but i dont understand what i am doing wrong.

For example

If Properties("AllowBypassKey", dbBoolean, True) Then

MsgBox "Warning"
Else

or

If (AllowBypassKey.Properties = True) Then

MsgBox "Warning"

Cheers
 
Last edited:
Finally solved it for those of you that are interested - i had to set the DAO database to the current db before executing the code. As follows:

Dim db As DAO.Database
Set db = CurrentDb

If db.Properties("AllowBypassKey") = True Then GoTo.......



3 Lines of code..... must have taken me nearly 3 days to figure out!
 

Users who are viewing this thread

Back
Top Bottom