access login verification code 2

' This section is used to check if a username or password is entered
If IsNull(Trim(Me.username )) Then
DoCmd.Beep
MsgBox ("Please enter a username! ")
Else
If IsNull(Trim(Me.password )) Then
DoCmd.Beep
MsgBox ("Please enter your password! ")
Else
' The following is for comparison with [login table]
Me.RecordSource = "select * from login table where username = '" & Me.username & "' and password='" & Me.password & "'"
'Set rs = GetRS(str)
If Me.Recordset.EOF Then
DoCmd.Beep
MsgBox ("There is no such user or the password is incorrect, please re-enter! ")
Me. username = ""
Me. password = ""
Me. username .SetFocus
Exit Sub
Else
DoCmd.Close
' Trial version usage limit
If n = 50 Then
DoCmd.Close
Else
n = n + 1
MsgBox ("Welcome to Chengde County Cadre Management System! ")
check = True ' Set the login flag
DoCmd.OpenForm ("Main Query Form")
End If
End If
End If

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325094474&siteId=291194637