|
Private Sub cmdyes_Click()
Dim Temp As String
If IsNull(Me![User_PassWord]) Then
MsgBox "您输入的密码不能为空,请重新输入!", vbOKOnly, "警告信息"
Else
Dim Rs As ADODB.Recordset
Set Rs = New ADODB.Recordset
Temp = "SELECT T_User.* FROM T_User WHERE T_User.UserName='" & Me.User_Name & "' AND T_User.PassWord='" & Me.User_PassWord & "';"
Rs.Open Temp, CurrentProject.Connection, adOpenKeyset, adLockPessimistic
If Rs.RecordCount > 0 Then
DoCmd.Close
DoCmd.OpenForm "F_PurchaseLog", acNormal, "", "", acFormReadOnly, acWindowNormal
Else
MsgBox "您输入的用户名和密码有误,请重新输入!", vbOKOnly, "警告信息"
End If
Rs.Close
Set Rs = Nothing
End If
End Sub |
|