Securing Objects

M

Matt Howard

I am trying to secure an administrative form on my
database. I have a main menu with several buttons and
each button operates with a macro. When I adjust
permissions so that our users can't use the admin form, I
get all the prerequisite Access messages, and then I get
the Halt macro window. How can I set up the database so
that the Halt window does not appear?

Thanks in advance,

Matt Howard
 
J

Joan Wild

You really can't deal with that, as long as you use macros.

You can write VBA code to open the forms instead.

Change the On Click event to [Event procedure] and click on the build button
to the right (...)

A code window will open two lines Private Sub... and End Sub. All you need
to do is put
DoCmd.OpenForm "NameOfForm"
between the two lines.

As for limiting users, I'd suggest you use the code in the security FAQ to
determine if a user is in a group. Based on their membership you could just
hide buttons on your main menu. Then you don't have to deal with the
permission denied messages. Also it is nicer for users if they aren't
presented with options they don't have access to.

In the Open Event for your main menu

If faq_IsUserInGroup("GroupName", CurrentUser()) then
me!cmdAdmin.visible = true
Else
me!cmdAdmin.visible = false
End if

Substitute GroupName for the name of your group that should see the admin
form button.
 

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