Can someone please help me with the code below. I keep getting a Run Time error 91 stating that the object variable or with block variable is not set. I ahve set all of my variables so I am lost.
Private Sub Command4_Click()
Dim db As Database
Dim rstUser As DAO.Recordset
Dim Main As Form
Dim User As String
Set rstUser = Me.Recordset
User = "User_Name = '" & [Text0] & "'"
With rstUser
.FindFirst User
If .NoMatch = True Then
MsgBox "Enter A Valid User Id", vbOKOnly
Else
If .NoMatch = False Then
DoCmd.OpenForm "Password Verification"
End If
End If
End With
rstUser.Close
End Sub
Private Sub Command4_Click()
Dim db As Database
Dim rstUser As DAO.Recordset
Dim Main As Form
Dim User As String
Set rstUser = Me.Recordset
User = "User_Name = '" & [Text0] & "'"
With rstUser
.FindFirst User
If .NoMatch = True Then
MsgBox "Enter A Valid User Id", vbOKOnly
Else
If .NoMatch = False Then
DoCmd.OpenForm "Password Verification"
End If
End If
End With
rstUser.Close
End Sub