Code:
Set rs = db.OpenRecordset("SELECT * FROM `agents` where username = '" & text1.text &"'")
If rs.recordcount>0 then
   If Text2.Text = rs("password") Then
        'valid login
   Else
        'invalid password
   End If
Else
   'Invalid Username
End If