Make button visible not working

Idris01

New member
Local time
Today, 20:25
Joined
Jun 10, 2011
Messages
9
HI all, not sure what I am doing wrong but I have two buttons on a form, depending on the name in the login field (text19) i need one or the other button to be visible and he other hidden. the two buttons are command 11 and 12. I need command11 to display if the name is "user name" and hidden if any other name

Private Sub Form_Load()
If Me.List19 = "user name" Then
Command11.Visible = True
Else
Command11.Visible = False
End If
End Sub

this code is in both the OnCurrent and OnLoad properties but of the form. when the user name is selected the button remains invisible all the time, probably becasue i have told it too somewhere:confused:
 
...when the user name is selected the button..

If the user must select or input their user name in the user name control, then the code needs to be in the after update event of that control. Also, when you do one thing to one of the buttons you must do the opposite to the other

If Me.List19 = "user name" Then
Command11.Visible = True
command12.visible=false
Else
Command11.Visible = False
command12.visible=true
End If
 

Users who are viewing this thread

Back
Top Bottom