L
Legacy 260294
Guest
Hi, I'm new here. I have encountered a problem in my project. I tried to make a log in form which connects to my project which is a School Library System. I have 2 Textboxes and a Command Button. I entered the correct details in the textboxes. But the code doesn't work. I used If-Then-ElseIf in using my Log in form. And it always runs the Else part. Here is the code:
I would like to know what is going on in my project. Please help me.
Code:
If loginfrm.txtUser = "admin" & loginfrm.txtPass = "adminpass" Then Unload Me
mainfrm.datetime.Caption = "Logged In at " & Now
mainfrm.welcome.Caption = "Welcome, Admin!"
mainfrm.Show
ElseIf txtUser = "librarian" & txtPass = "libpass" Then
Unload Me
mainfrm.Delete1.Enabled = False
mainfrm.datetime.Caption = "Logged In at " & Now
mainfrm.welcome.Caption = "Welcome, Librarian!"
mainfrm.Show
Else
MsgBox "Wrong Username/Password. Try Again.", vbCritical, "Error."
End If
I would like to know what is going on in my project. Please help me.