Type mismatch

Mechele

Registered User.
Local time
Today, 07:49
Joined
Jan 25, 2002
Messages
121
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?
 
Let me guess, you're using Access 2000 or 2002? If so, set a reference to the Microsoft DAO Library 3.x. You may also want to remove the reference to ActiveX Data Objects 2.x Library.
 
I'm using Access 2000. Thanks! I never would have guessed what was wrong!! :O)
 

Users who are viewing this thread

Back
Top Bottom