I'm getting a type mismatch in the following code: The statement
Set rs = CurrentDB.OpenRecrodset("LoginTable") is highlighted.
Private Sub Login_AfterUpdate()
If Me.Login = "leadership" Then
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("LoginTable")
With rs
.AddNew
.Fields("LoginName") = Me.Login
.Fields("LoginDate") = Me.LoginDate
.Fields("LoginTime") = Me.LoginTime
.Update
.Close
End With
DoCmd.OpenForm "MainMenuForm"
DoCmd.Close acForm, "LogInForm"
Else
MsgBox ("The password you typed in is not correct. Please try again."), vbCritical
DoCmd.GoToControl "Login"
End If
End Sub
In the loginform, me.login input mask field property is password. Would that cause the type mismatch?
Set rs = CurrentDB.OpenRecrodset("LoginTable") is highlighted.
Private Sub Login_AfterUpdate()
If Me.Login = "leadership" Then
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("LoginTable")
With rs
.AddNew
.Fields("LoginName") = Me.Login
.Fields("LoginDate") = Me.LoginDate
.Fields("LoginTime") = Me.LoginTime
.Update
.Close
End With
DoCmd.OpenForm "MainMenuForm"
DoCmd.Close acForm, "LogInForm"
Else
MsgBox ("The password you typed in is not correct. Please try again."), vbCritical
DoCmd.GoToControl "Login"
End If
End Sub
In the loginform, me.login input mask field property is password. Would that cause the type mismatch?