Hi can someone help me out with my code, i tried to compare the text that i get in my form and compare with the value that i have on my table but it seems that i'm getting type mismatch error even though the data type of the
Username Field on my table is Text , same goes for my Password Field on my table as text on ms access
Here is my code on VBA:
Option Compare Database
Private Sub Command1_Click()
If (DLookup("Username", "User", "Username = '" & Me.txtUserName.Value & "'")) And (DLookup("Password", "User", "Password= '" & Me.txtPassword.Value & "'")) Then
DoCmd.OpenForm "Form1"
Else
Me.txtUserName.SetFocus
Me.txtPassword.SetFocus
MsgBox "Incorrect Input, Please enter the Username and Password Required"
End If
End Sub
Username Field on my table is Text , same goes for my Password Field on my table as text on ms access
Here is my code on VBA:
Option Compare Database
Private Sub Command1_Click()
If (DLookup("Username", "User", "Username = '" & Me.txtUserName.Value & "'")) And (DLookup("Password", "User", "Password= '" & Me.txtPassword.Value & "'")) Then
DoCmd.OpenForm "Form1"
Else
Me.txtUserName.SetFocus
Me.txtPassword.SetFocus
MsgBox "Incorrect Input, Please enter the Username and Password Required"
End If
End Sub