Database Security questions.

Infiltrator64

Board Regular
Joined
Dec 19, 2004
Messages
63
How can I hide the Design button for a user login but display it for admin login?

I have my db locked down now so users can't save any design changes but they can still click on the design button and see the design.
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
Say the button is [cmdDesign] and the login group is [UserGroup].

On the Current event of the form, place this one-liner:
[cmdDesign].Visible=([UserGroup]="Admin")

In case you haven't played with events before, set it up like this:
In the Form properties, pick the Events tab.
Double-click the blank line next to Current. You'll see Event Procedure.
Click the Builder (...) button at the right of the line, and you'll see the code module.
In the blank line in the routine, paste the code above. You will need to change control and field names to suit.

Denis
 

larsesim

New Member
Joined
Dec 16, 2002
Messages
3
I can't get this working. Using a simple msgbox UserGroup doesn't return any value.
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
The answer was based on having user-level security (or some security scheme) set up.

You may find this useful as a starting point.

Denis
 

Forum statistics

Threads
1,078,373
Messages
5,339,814
Members
399,330
Latest member
mallikharjun

Some videos you may like

This Week's Hot Topics

Top