Login form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have login form with user name and password. Currently my code works if i
enter correct password and user name it will open form and if password or
name or both is not valid then it will show msgbox. What i am looking for
saperate msgbox for password and user, if user name correct but password not
then i need show msgbox "invalid password" and same thing if user name, I
need to set focus to incorrect text box. Also if both incorrect then msgbox
"Invalid password a amd user name". Please help me out. Thanks.

======================
If txtUserName = "admin" And txtPassword = "manager" Then
DoCmd.OpenForm "frmMain"
else
If Not (txtUserName = "admin") and Not (txtPassword = "admin") Then
MsgBox "Invalid User Name and Password."
End If
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

Similar Threads

Login form user name and password 6
MsgBox 3
Run Time Error 3075 2
error 2489 1
2 users - 1 login - 2 forms 1
Lock out a user from using a field 2
Login Form Help Needed 5
login form help required 6

Back
Top