Shift Key Bypass

burrina

Registered User.
Local time
Today, 08:57
Joined
May 10, 2014
Messages
972
I was wondering if when you open a db that someone else has sent you, normally you have to enable it and I don't mean before opening it. So that if you had an autoexec or code that ran when the db opened you could not use it since the db was not enabled.

Is their a way to allow someone to open it normally (enable) then the next the next time use the db opens use the autoexec ?
 
not quite sure what your concern is - you click enable and then the autoexec runs - the enable option does not appear again on next opening.

If you are saying you want to bypass the enable button, you need to place the db in a trusted location before opening it.

if the file is typed as .accdr (runtime) then the enable button does not appear. Instead you get a warning that the file might contain unsafe content - but this will appear every time you open the db unless it is in a trusted location.

To prevent either of these situations you need some vba code that creates a trusted location for Access - being the directory you have put the db, or a parent directory with subfolders enabled - but the code still needs to run after the user has either clicked the enable (accdb/accde) or open (accdr) button so they have to do this at least once.
 
My copy is in a trusted location and even if the user has the db in the same folder and the db is setup with a login form and a autoexec and the shift key disabled, then the db will open but since the login form for example opens modal and you can't click on enable so essentially the db is locked.

Hope that makes sense. The db is a .accdb
 
It depends on your purposes - if this is distributing to a client, you should be distributing as accde or accdr - in which case you get the warning that the file might contain unsafe content rather than the enable button.

if this is an accdb being sent open source for the user to access the code, you will need to enable the bypass key.

trusted locations are unique to each user so just having matching paths for the db is not enough.
 
So if I code the db to set the location as trusted will this enable it or would I still have to disable the bypass key? Or can the user themselves set the location as trusted and that will enable it?
 
So if I code the db to set the location as trusted will this enable it or would I still have to disable the bypass key?
for the first time, you would need to disable the bypass key, or change the accdb to accdr, and then have code to set the trusted location.

Or the user can set the location as trusted (if they have the full version of access) prior to opening the db
 

Users who are viewing this thread

Back
Top Bottom