Private Sub cmdOK_Click()
adoUsers.RecordSource = "select * from tblUsers where username='" & txtUserName & "'"
adoUsers.Refresh
If adoUsers.Recordset.RecordCount > 0 Then
If adoUsers.Recordset.Fields("password") = txtPassword Then
frmMain.Show
Unload Me
Else
MsgBox ("Wrong Password!")
txtPassword = ""
txtPassword.SetFocus
End If
Else
MsgBox ("Wrong Username!")
txtUserName = ""
txtUserName.SetFocus
End If
End Sub
0 comments:
Post a Comment