Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problems with a form and a cancel button
I have a form with: 1 accept button(commandbutton1),1 cancel
button(commandbutton1),1 user textbox(textbox1) And a pasword textbox(textbox2) I attached my code: Private Sub CommandButton1_Click() a = TextBox1 b = TextBox2 If (b = "marcos" & a = "aaaaa") Then d = MsgBox("Contraseña Inválida", vbOKOnly, "Verifica la contraseña") Else Programador End Sub Private Sub CommandButton2_Click() UserForm1.Close End Sub Private Sub UserForm_Initialize() TextBox1.PasswordChar = "*" End Sub I have 2 problems: 1)I don't know how to tell vb to close the form (Private Sub CommandButton2_Click()) whenb the cancel button is clicked 2) why it's not working right the "If (b = "marcos" & a = "aaaaa")", I know it's not working because I could activate the programador macro without writing the b=textbox2, (writing just the pasword works but I have 5 different users with five different paswords) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
message box without ok or cancel button | Excel Discussion (Misc queries) | |||
InputBox - cancel button | Excel Programming | |||
Cancel button | Excel Programming | |||
Cancel Button | Excel Programming | |||
Input Box Cancel Button | Excel Programming |