Blocking User Access To App

R

RLN

My app has a password screen at startup.
If the developer's pass is entered, I want to make sure the app is fullt
enabled (F11 key, all menus, right click availability, etc)
If the user's password is entered, I need to block use of the F11 key, and
right clicking of the mouse on forms, making sure the database icon is hidden
from the menu bars, etc.

I have to admit I've struggled with not knowing exactly where the best place
would be to enable/disable these kinds of things....better in a macro, VBA
code, or under Tools/Options, etc?
For starters I thought I could set this up with a macro and disable the F11
key so users can't get to the container. After the macro runs, the F11 key
is not disabled and can still be pressed by users.

I realize I'm kludging along trying to make this work, but is there a good
VBA module that might address this need, or would it be better to disable
right clicking on a form when it loads then re-enable it when the form
closes? (seems like a bunch more code to maintain that could get scattered)

Thanks......
 
A

Albert D. Kallal

You most certainly can, and should hide all of the ms-access interface. The
options to complete hide and keep people out of the ms-access interface can
easily be done using the tools->start-up options. Using those options allows
you to complete hide the ms-access interface (tool bars, database window
etc).

Also, using these options means you do not have to bother setting up
security.

Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

Check out:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm

After you try the application, you can exit, and then re-load the
application, but hold down the shift key to by-pass the start-up options. If
want, you can even disable the shift key by pass. I have a sample mdb file
that will let you "set" the shift key bypass on any application you want.

You can get this at:

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

Of course, during development, you will hold down the shift key so your
startup settings don't run. You then develop for awhile, and then to test in
"user" mode, you exit..and then re-enter the application without the shift
key bypassed. You will likely do this dance all day long as you run/test as
user mode, and then flip back in to developer mode (shift key used..so you
don't get the main custom menu). So, you can't develop, or really modify
things when you run your application with the startup settings...so you must
shift-by-pass them when you want to work.

And, in fact, I use alt-f4 to exit the application...the mdb file should
still be highlighted in the windows explore..so, then you hit enter key
(and, hold down shift key if you need be). This key stroke sequence and
exiting and re-entering the application will occur CONSTANTLY all day long
when you are developing.

When you finally have things just right...you create the mde
you plan to distribute...

So, use the shift key to flip between "user test mode", and "development
mode".

Once your application is ready, then you create the mde. You can
run the code to lock out the shift key by-pass BEFORE you create the mde, or
after, it really don't matter.

however, to develpuemtn, you CAN NOT really development and turn off all of
the startup options with code...you simply have to get in the habit of
holding down the shift key to develop, and then not holding it down to test
things from a user point of view.

Once you have things right, then your simply distribute that mde to your
users with everything locked up....

There is not really a need to waste time for code that flips your
application from "user
mode" to "development mode". Just use the shift key....
 
R

RLN

Albert,

Thanks loads for taking the time to provide such helpful information.
Wow...between you and Allen Browne, I wouldn't mind sitting down for coffee
and talking "Access Shop" with you both and spend the afternoon learning more.

My users know that the F11 key is the magic "key to the kingdom of code &
design". Can another key other than F11 be the targeted shift key to enable
and disable in an app?

Also, when I use the line, "ChangeProperty("AllowBypassKey", dbBoolean,
False) in my code to disable F11, I can still press it and get the container.
There is still something I'm not doing correctly. I'll keep digging on it.

I know about the startup opitions. I just don't want to lock myself out of
the app during development (i.e. by not being able to right-click to go to
design mode, etc)
 
A

Albert D. Kallal

If you set things up correctly, then the f11 key should not do anything

Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.

Check out:

http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm


In the above, hitting f11 does not do anything at all....

I suspect it is one of the "use built in keys" settings in the startup
options. (as mentioned, these options are all skipped if you hold down shift
key). Remember, it not only shift key here, but f11, and a good number of
other keys that get disabled with CORRECT use of the startup options. It is
for this reason I suggest the "shift key" dance is about the only way to
mange this..as there is quite a few more options then just f11 and the shift
key that you want to disabled in a production environment....

you can take a look at the above startup opptions, but I susecpt it just a
matter of un-chcked the allow built in access keys option in the startup
pane..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top