Security - Minimize with Modal

roland_access

Registered User.
Local time
Today, 21:33
Joined
Feb 13, 2002
Messages
35
Have set up database security fully and properly. What I need to do now is stop users from closing forms and editing data directly from the underlying tables. They must only be able to edit data via forms.

I have set permissions for the users so that they cannot view forms in design view. I have also disabled Access Special Keys and the Shift bypass on start up.

Now onto the forms themselves. What I have at the moment is a Pop Up and Modal form with no control box (no minimize, maximize or close buttons). This, coupled with them not being able to view the design means they cannot get "behind" this form to the tables.

All this is fine, apart from of course they need to be able to go back to their desktop now and then without closing the database. I have tried a few things; calling the Quick Launch shortcut from a command button causes an Office confirmation message. Enabling Windows' Quick Launch toolbar and educating users on its View Desktop shortcut seems crude.

I have spent a lot of time with the MS Security FAQ, but could not get the code to work that deals with changing a groups table permissions when closing a form.

Another thing, when you are using a pop up form and minimize the database, often when restoring the database the form is not maximized, even if a DoCmd.Maximize is used somewhere on that form.

Any ideas please?
 
Last edited:
Your method of maximizing the form along with the Popup and Modal properties set to Yes is a little extreme. Your application is taking over their computer. Have you tried removing all of the menu bars and tool bars and using non maximized forms?

'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 tool bar or menu bar...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarYes

'This will hide a tool bar or menu bar when needed...
DoCmd.ShowToolbar "YourToolBarNameHere", acToolbarNo

'This will hide the Menu Bar...
DoCmd.ShowToolbar "Menu Bar", 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

'Visit this link to see how I disable the Shift key [from within the db] using VBA...
Disable the AllowBypassKey property

Visit this link for more tricks...
Hide all Access Toolbars and Menubars


'HTH
 
Last edited:
Dont really like the idea of a hidden command button, my forms are already full as it is! I still need Admins to be able to close the form though via right click, going into design view and then closing.

Also, with your code and a non maximized form they could simply drag it down their screen and have access to the tables which is bad!
 
Dont really like the idea of a hidden command button, my forms are already full as it is! I still need Admins to be able to close the form though via right click, going into design view and then closing.
That is just an example on how the "programmer" would use the code to hide/unhide objects. Your db is left open to all kinds of problems if the users can open any of the objects in design view. I am curious as to why you want the Admins to right-click and select the Design view of a form just to close the form. What is going to stop them from accessing your db objects? They could easily alter the design of the form or close the form and then open a table. You should program an exit button for them to use to close the form and return to your main form and/also exit the db.

Also, with your code and a non maximized form they could simply drag it down their screen and have access to the tables which is bad!
You need to hide the db window and all toolbars and menubars. The code I posted above will do just that.

The user should be restricted so that they can not access any objects that you do not want them to. Using forms and command buttons for navigation is all they should need if the db is adequately constructed.

I am not knocking the design of your db, I just want to ensure that you have protected your db from your users. Accidents can happen but most can be prevented. The code I posted above is just some examples of VBA that will help deter a person from getting inside of your db but it will not stop them. You should read up on Access security if you really want to protect you db. Access security will enable you to assign workgroups and permissions.

HTH
 
I agree with ghudson. You approach is to the left of paranoid (just joking) and leave your db vunerable to infiltration. Ghudson's recommendations will do what you want and are truely the best solution.
 

Users who are viewing this thread

Back
Top Bottom