Command Button Help

G

Golfinray

I want a command button to ask for a password when pushed or capture the name
of the user. If the password or the user is correct, it makes 3 other command
buttons visible (I assme using the isvisible control.) The 3 command buttons
then take the user to 3 different forms. Is that possible? Thanks!!!
 
J

Jeanette Cunningham

make the command button popup a form where the user enters a password or
their name.
Use a select case statement on the value entered in the popup form.
Example
Select case Me.txtPassword
Case 1
Me.cmd1.Visible = True
Me.cmd2.Visible = True

Case Else
Me.cmd1.Visible = False
Me.cmd2.Visible = False
End Select

Jeanette Cunningham
 
R

Rich K

Yes it's possible.

You might try some code like this behind the click event of your command
button:

Dim strPassword As String
strPassword = InputBox("Whats the password?")
If strPassword = "MyPassword" Then
' manipulate the properties of the command buttons
commandbutton1.visible = true
commandbutton2.visible = true
' etc
Else
commandbutton1.visible = false
commandbutton2.Visible = False

End If
 

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