Dim flag
Private Sub cmdlogin_Click()
While Not Data1.Recordset.EOF
If Data1.Recordset.Fields(0) = Text1.Text And Data1.Recordset.Fields(1) = Text2.Text Then
flag = 1
GoTo valid:
Else
flag = 0
Data1.Recordset.MoveNext
End If
Wend
valid:
If flag = 1 Then
MsgBox "Valid User"
Else
MsgBox "inValid User"
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub
No comments:
Post a Comment