Hey im creating a program which need to be logged into pw and uid. I having problems with logging in because i dont know how to write the coding correctly.
if user name password ..<><<><<><><>
end if
user name password<><><><><><><><>
else
exit message
logout
end if
end
That is really confusing, dont you want something like...
**Create 2 text boxes (text1 and text2) and a command button (Command1)**
Const username1 = "user1"
Const password1 = "pass1"
Const username2 = "user2"
Const password2 = "pass2"
Private Sub Command1_Click()
username = Text1.Text
password = Text2.Text
If username = username1 And password = password1 Then
MsgBox "correct username and password for user1"
Else
If username = username2 And password = password2 Then
MsgBox "correct username and password for user2"
Else
MsgBox "wrong username or password. Please try again"
End If
End If
End Sub
This will detect if the username or password is correct, though i would do it via a database. So if username is username3 in the database, then the password must also be username3
Hope that helps you out