Disable Design View with Password Protection

Cosmos75

Registered User.
Local time
Today, 16:27
Joined
Apr 22, 2002
Messages
1,281
I am finishing up a database and am wanting to put the finishing touches on it.

How to I disable the design view? I would like it to be available only with a password. Am not using workgroup security, only using a general password to open the database (i.e. anyone with the password can open the database), but I don't want anyone to mess with the design without a specific password. Is there a way to accomplish this?
:confused:

Also, are there any possible problems with disabling ALL toolbars? Will that make it difficult for me to go back in and change/add forms/tables/queries/reports...?

Any suggestions and or tips would be appreciated.:)
 
You could release the database as an MDE (but make sure that you have a backup of the original!)
 
Seems scary to do this!

Are there inherent problems with doing this? What about if I need to redesign/add forms/queries...? What about the data that is has been added in the MDE that isn't present in the original MDB file? Never done this before so any warnings and tips on hat to do and not to do would be greatly appreciated.

I know I will have to back-up the original file since I can't change anything in the MDE file.
 
Have to admit to not being an expert on this but would presume that when you make changes to forms etc in the mdb file, make sure that everyone is out of the mde and then import the tables from the mde file. That will make your mdb up to date and you can create a new mde file.
 
MDE have a certain number of limitations in comparison with MDBs, namely (since it is among the purposes of making an MDE) that the DB is not modifiable anymore (no new query, etc).
Indeed, you will want to make backup of your MDB , then create an MDE and test how it is running to detect eventual other problems. Basically, all dynamic processes that imply modifications of the DB are not allowed (changes of DB properties, etc) and menus of that kind are disabled.

Lightweight solution is to just set the AllowDesign view option of your forms to no and disable access to menus allowing to change this property (right-click menu etc.)
I have code doing this that I can post if you are interested.

However, beware that this is DOES NOT provide real secureness to your DB (against modifications, getting code and DB objects, et.). If security is your objective, you have to look into Access security features, and eventually making an MDE.
 
Last edited:
Sounds good.

Alex,

Sure I'd like to try out your code and see if that would be better suited for me.

Thanks for all you help!
 
Alexandre,

Do you still have that code you mentioned???
 
The below code will disable (hide) all menu bars and tool bars. Ensure that you have a way to enable (unhide) the menu bars and tool bars (transparent command button) before you hide them!

'this will disable all menu bars and tool bars
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i

'this will enable all menu bars and tool bars
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = True
Next i

An added bonus is the right click option is disabled if the menu bars are disabled with the above code.

Use the 'ShowToolbar' command if you need to display a toolbar...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarYes

This will hide a toolbar when needed...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarNo

You can also hide/unhide the database window with code...

'Hide the database window
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide

'Unhide the database window
DoCmd.SelectObject acTable, , True


HTH
 
Cosmos75, see if the attached example is what you're looking for. The password to enter 'Admin Mode' is password (case sensative).

The background is used to hide the fact that Access is running, so the finished database just appears as a series of pop-up windows.

You can achieve all of the Macro functions with code, I'm just too lazy to go through and change it all for this example ;)

This example also shows you how to achieve MouseOver text.


HTH
 
Last edited:
on compile, throws up a couple of errors - stopping the functionality of the Db.
Change this line

Code:
    MsgBox "Error " & Err & ": " & Error$, 0, "Password"

to

    MsgBox "Error " & Err.Number & ": " & Err.Description, 0, "Password"
 
If your referring to the example is posted, Fizzio, I'm surprised. I get no errors of any kind with that type of setup, either on compile or when being used...
 
Can someone post a 97 version of the database please. I would like to take a look at it. Thanks!

Vassago
 
Not a criticism Tezcatlipoca, just threw up a compile error on my machine - just in case anyone had the same problem. ;)
 
Fizzio said:
on compile, throws up a couple of errors - stopping the functionality of the Db.
Change this line

Code:
    MsgBox "Error " & Err & ": " & Error$, 0, "Password"

to

    MsgBox "Error " & Err.Number & ": " & Err.Description, 0, "Password"

Same thing happened to me...
 
That's curious. I just downloaded my own example and tried to run it on my home machine (same Access version, same OS) with the same result as you guys. Wierd. There must be something on the office machine it's referencing that isn't on other machines.
 
did this get sorted

did this one get sorted ?

i notice in the references to the db there is the following reference
MISSING: SMARTTOOLBAR2000.mde

just as an aside by editing a bit of the code removing the &err and the error$,0 when you get the code erro the system works fine
 

Users who are viewing this thread

Back
Top Bottom