Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rookie_sql
Constraint Violating Yak Guru
443 Posts |
Posted - 2006-07-25 : 06:06:02
|
Hi i've got about 4 forms and on each form i've got commands buttons that peform certain actions, i would only like certain people to be able to access these buttons, so what am looking for is a way of enabling or disabling the buttons on the form, when they log in, is this possible in access. I see there is a security options would they peform this for me ? |
|
Pace
Constraint Violating Yak Guru
264 Posts |
Posted - 2006-08-10 : 11:18:56
|
you could create a public variable in a module eg: strUser in PublicVarsOnce your user logs in set strUser = userName.textOnce they click the command button in question you could then sayIf strUser = "yourName" ThenDO IT Elsemsgbox("You do not have permission!")hth Pacewhen life hands you lemons, ask for tequila and salt |
 |
|
Pace
Constraint Violating Yak Guru
264 Posts |
Posted - 2006-08-10 : 11:20:11
|
oooops... What you might want to do is sayIf strUser = "yourName" Then me.cmdYourButton.Visible = Trueelse me.cmdYourButton.Visible = FalseEdit: alternatively set the property Visible to false at design time, then on the Form_Open Event do the above... which would set the button appropraitely at runtime. when life hands you lemons, ask for tequila and salt |
 |
|
|
|
|