Button visible or invisible based on who the user is??

Johnnyw

Registered User.
Local time
Today, 21:06
Joined
Feb 19, 2001
Messages
13
I have a main pop up form that allows users to select which form they want to open. There are 5 users who each have their own form, but the main screen shows all 5 buttons that links to all 5 forms. I want to only show the button that belongs to that user. I have set up Access permission security to each of these forms. Basically I want a statement that does something like: If the current user is ________ Then "This button" is visible.

Maybe I've answered my own question but I do not know much VB. Anyones help is appreciated.
 
Why dont you just create a Data protection on the button. (password prompt) This way you have all 5 users seeing the buttons, but if they dont have the correct password then they wont be able to access the button. You could try this:

Dim strPasswd

strPasswd = InputBox("Please Enter your Password in the box below.", "Restricted Command button")

If strPasswd = "YOUR PASSWORD" Then

(PUT WHAT EVER YOU WANT TO RESTRICT IN THIS PART, SO FOR INSTANCE me.delete = "False"
WOULD DISABLE A DELETE BUTTON)

Else

Exit Sub

End If

Make sure you put this on the ONCLICK EVENT.


It is worth a try.

Hope i have helped.

[This message has been edited by DaleFromEngland (edited 09-10-2001).]
 
See the example here for more help. Basically you set the Visible property to 'false' as part of an an if-then.
 

Users who are viewing this thread

Back
Top Bottom