G
Guest
I asked a question and recieved an answer, tried the answer and it didn't work.
Now I have questions about the answer but can't find my original post.
My question was about 3 buttons on an unbound form that when pressed would
look at the UserName (not CurrentUser), and depending on that name, certain
Users could access only those buttons that they were approved for.
so... here's the response I received:
"I would suggest that instead of having a message pop up when they click a
forbidden button, that you instead hide the button from them. I think users
get annoyed to see an area of an application, and then be told 'you can't go
there'.
In the open event of your unbound form..
Private Sub Form_Open(Cancel As Integer)
Select Case fOSUserName()
Case "crifenbug", "jcastendyk", "cpurnel", "bshoats"
Me!PremButn.Visible = True
Me!ProcButn.Visible = False
Me!EnrolButn.Visible = False
Case "jdoe"
Me!PremButn.Visible = False
Me!ProcButn.Visible = True
Me!EnrolButn.Visible = False
End Select
End Sub
THIS IS HOW I ACTUALLY USED IT. BUT IT'S NOT HIDING ANY OF THE BUTTONS ON
OPENING THE FORM.
Private Sub Form_Open(Cancel As Integer)
Select Case fOSUserName()
Case "crifenbug", "jcastendyk", "cpurnel", "bshoats"
Me!PremButn.Visible = True
Me!ProcButn.Visible = False
Me!EnrolButn.Visible = False
Case "jdoe"
Me!PremButn.Visible = False
Me!ProcButn.Visible = True
Me!EnrolButn.Visible = False
End Select
End Sub
Thanks for any help!
Connie
Now I have questions about the answer but can't find my original post.
My question was about 3 buttons on an unbound form that when pressed would
look at the UserName (not CurrentUser), and depending on that name, certain
Users could access only those buttons that they were approved for.
so... here's the response I received:
"I would suggest that instead of having a message pop up when they click a
forbidden button, that you instead hide the button from them. I think users
get annoyed to see an area of an application, and then be told 'you can't go
there'.
In the open event of your unbound form..
Private Sub Form_Open(Cancel As Integer)
Select Case fOSUserName()
Case "crifenbug", "jcastendyk", "cpurnel", "bshoats"
Me!PremButn.Visible = True
Me!ProcButn.Visible = False
Me!EnrolButn.Visible = False
Case "jdoe"
Me!PremButn.Visible = False
Me!ProcButn.Visible = True
Me!EnrolButn.Visible = False
End Select
End Sub
THIS IS HOW I ACTUALLY USED IT. BUT IT'S NOT HIDING ANY OF THE BUTTONS ON
OPENING THE FORM.
Private Sub Form_Open(Cancel As Integer)
Select Case fOSUserName()
Case "crifenbug", "jcastendyk", "cpurnel", "bshoats"
Me!PremButn.Visible = True
Me!ProcButn.Visible = False
Me!EnrolButn.Visible = False
Case "jdoe"
Me!PremButn.Visible = False
Me!ProcButn.Visible = True
Me!EnrolButn.Visible = False
End Select
End Sub
Thanks for any help!
Connie