Real-time error'91 'Object variable or with block variable not set

The amendment is a simple password system
Private Sub Command1_Click ()

If Text1.Text = “” Or Text2.Text = “” Or Text3.Text = “” Or Text4.Text = ” “Then
MsgBox” Please re-enter! “
Else
If Text3.Text = Text4.Text Then
Adodc1.Recordset.MoveFirst / / This error
Do While Adodc1.Recordset ( “Username”) Text1.Text And Not Adodc1.Recordset.EOF
Adodc1.Recordset.MoveNext
Loop
If Adodc1.Recordset.EOF Then
MsgBox “not found”
Else
Adodc1.Recordset ( “password”) = Text3.Text
Adodc1.Recordset.Update
MsgBox “success to amend the password!”
Unload Me
End If
Else
MsgBox “inconsistent with the password!”
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
Text4.Text = “”
Text1 .SetFocus
End If
End If

End Sub

Leave a Reply