How to Disable VBA Screen

C

charles.kendricks

Well I guess we all have one.....I have one user who knows just enough
about access, and VBA to be very very dangerous. How do I disable the
F11 shortcut to the VBA code window.
 
A

Albert D. Kallal

You should be distribution a mde to each user. That way, they can't modify
the code...

Further disable the shift key start-up..and you locked out 99% of your
users....

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
 
G

George Nicholson

In addition to Albert's comments, you could simply apply a password to
protect the VBA project. It doesn't prevent the user from getting to the VBE
screen, but it prevents them from seeing, changing or adding code to the
file (in other words, even if they get to the VBE, they can't do anything
there).

In VBE: Tools> (Your project) Properties> "Lock for Viewing" and "Password
to View"

Password crackers are out there, so this is just a roadblock for people who
might know "just enough to be dangerous" but not truly serious hackers.

As far as disabling F11 goes:
In the Access User Interface: Tools>Startup: uncheck "Use Access Special
Keys". This disables Alt-F11 and other Special keys. It also prevents
breakpoints you set from actually breaking (since that acts like alt-F11),
so don't forget you've turned them off if you are debugging :). However,
unless you have disabled the Shift-Bypass, this setting can be changed back
at will. You would also have to alter your Menus to remove the VBE option
(Tools>Macro>VBE), as well as lock-up the menus to prevent a user from
re-adding the VBE option via Customize. Also prevent Users from getting to
the Database window so they can't open a code module in Design view...

If this is a "casual" app, it's much easier to simply apply a password to
the code project and not sweat users getting to the VBE :)

HTH,
 
I

IRS Intern

I disagree

you should have a real database and a real backup strategy.. and teach
this person to actively develop


a Jr Database Developer is able to shape your company.
Work with them to be careful and help to improve your app
 

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