Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object variable or With Block Variable Not Set Error

Status
Not open for further replies.

DYM03

Technical User
Mar 6, 2003
28
US
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
 
Nevermind I figured it out. I was closing the recordset in the wrong place.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top