p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   prevention of edit forms/tables (http://p2p.wrox.com/showthread.php?t=6109)

damnnono_86 November 12th, 2003 11:18 PM

prevention of edit forms/tables

how do i prevent user from entering into the 'design view', 'datasheet view' of my form??? how can i prevent them for entering to the database window (where you can choose to create table in design view or wizard.)??

pls advice

U.N.C.L.E. November 13th, 2003 04:52 AM

First, make a backup of your database! Have you done that yet? Good.

Now, take a look at Tools|Startup menu. There is a checkbox that says "Display Database Window". This dialog controls the menus, menu items, etc. that your user will see when the database first starts up... You can play around with the various settings, but be forewarned that some people have locked themselves out of their own database playing with these settings. Which is why I strongly recommend to make a backup before "playing" with the settings.

One catch: Your user, if sophisticated enough, can bypass your startup settings by holding down the shift key when first opening your database. This will also bypass any autoexec code.

Solution: You have to set the "AllowBypassKey" property to false and add it to the database properties collection. This can only be done via VBA code.

If you're interested in digging deeper... reply appropriately.

SerranoG November 13th, 2003 08:53 AM

The Man from UNCLE (insert secret agent music here [:p]) answered the second part of your question. Here's the first part.

After you make your back-up (hint, hint) you click on TOOLS > DATABASE UTILITIES > MAKE MDE FILE. This will turn your MDB into an MDE. An MDE is (sort of) an executable-only version of your database. Access will not let you make an EXE file, but the MDE is close. The MDE will not let you edit or manipulate form designs, etc; and it strips the VBA code out of the database so it's not even visible to the user. Together with UNCLE's (not so secret) advice, this, and then creating custom toolbars, you can keep people out of your database's underwear (so to speak). :D

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division

sal November 13th, 2003 10:41 AM

Since you made a backup. I should not have to say that again.
Now, make sure that you do not lock yourself out of your own database by creating a new toolbar. I have had wo many folks ask me to crack their database open because they locked themselves out by creating a new toolbar and setting it as default.


damnnono_86 November 13th, 2003 10:09 PM

hi U.N.C.L.E.,

i have heard alot of people saying abt the shift key, could u tell me how can the shift key be used to bypass the autoexec function????

and of course could u guide me on the VBA coding. thanks!

pls advice

damnnono_86 November 13th, 2003 11:45 PM


creating mde file is a good one. i have another question that pops up on my mind when trying the methods..

this database are meant for normal users (those who have no access to coding/tables etc) and admin (those who have access to the tables coding and everything).

i have put in the method u all have taught me. but if in any point of time that i (admin) wish to make some changes to my database so how can i be able to do that??? as i have the access to the tables/coding in my backup database, i can't change from there as that will not be the same as the one where users have make some modification of the datas. so how can i make changes (coding/tables format etc) on the database (the one user is using) that i have disable the 'database window'???

pls advice

U.N.C.L.E. November 14th, 2003 07:29 AM

You might want to think about creating a FE/BE model. The front end (FE) as the user interface which can be an .MDE format, and the back end (BE) database in one central location which will be your data container.

As for code examples... Direct from MS...
Please take a look as this MS web document (search for AllowBypassKey):


Good Luck!

P.S. Be sure to back up database before running your AllowBypassKey code!

SerranoG November 14th, 2003 09:02 AM

The Man from UNCLE's advice is good... put the tables and queries in an MDB file and put the forms and reports in an MDE and link them.

You can password protect the MDB half with the tables so that users cannot edit them. They will only able to affect the data via the forms in the MDE. The MDE half will be only available in a limted way so they cannot do damage.

Remember to keep an MDB version of the forms and reports so you can upgrade them at a later time. When you upgrade them, turn them into an MDE again and give that to the users again.

Just remember, keep-back ups of everything unprotected with no passwords, etc. somewhere where only you can get at it so if you accidentally get locked out you have the source information.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division

damnnono_86 November 16th, 2003 10:47 PM


i have try the method ... regarding the "AllowBypassKey"

but how do i use the special keys (eg.shift key) to open the database???

pls guide me.

vladimir November 16th, 2003 11:38 PM

Go back to your MDB version of "forms and reports" database to make changes.


All times are GMT -4. The time now is 01:22 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.