Hello, I am having some trouble getting my little cheap password screen to work like I want...Heres what Im trying to get: if the UserName is blank at any time..you get a popup saying theres no username...but if the password is right AND user name has text in it the program opens...heres my code:
Private Sub cmdOK_Click()
If txtUserName = "" Then
MsgBox " Enter A Valid User Name!"
LoginSucceeded = False
txtUserName.SetFocus
End If
If txtPassword = "password" Then
LoginSucceeded = True
Me.Hide
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
If LoginSucceeded = True Then
Form1.Visible = True
Form1.Label1.Caption = "User: " & frmLogin.txtUserName & "..Active"
End If

So far all it does on the username popup message but if the password is right it opens anyway...sorry if this is confusing im still new...thanks