hugox03 > 06-05-14, 11:53 PM
Private Sub cmdlogin_Click()
If IsNull(Me.cbtendangnhap) Or Me.cbtendangnhap = "" Then
msgBoxUni DLookup("[Description]", "ThongBao", "[msgNo] = 3"), vbCritical, "Đang nhâp ..."
Me.cbtendangnhap.SetFocus
Exit Sub
End If
If IsNull(Me.txtpassword) Or Me.txtpassword = "" Then
msgBoxUni DLookup("[Description]", "ThongBao", "[msgNo] = 4"), vbCritical, "Đang nhâp ..."
Me.txtpassword.SetFocus
Exit Sub
End If
If Me.txtpassword.Value = DLookup("matkhau", "tblUser", "[ID]=" & Me.cbtendangnhap.Value) Then
id = Me.cbtendangnhap.Value
msgBoxUni DLookup("[Description]", "ThongBao", "[msgNo] = 5"), vbInformation, "Đang nhâp ..."
Me.Visible = False
DoCmd.OpenForm "frmFlashScreen"
Else
msgBoxUni DLookup("[Description]", "ThongBao", "[msgNo] = 6"), vbExclamation, "Đang nhâp ..."
solandangnhap = solandangnhap + 1
Me.txtpassword.SetFocus
End If
If solandangnhap > 2 Then
msgBoxUni DLookup("[Description]", "ThongBao", "[msgNo] = 7") & vbCrLf & "Vui long lien he voi Admin de biet them chi tiet!", vbCritical, "Vuot qua gioi han nhap mat khau!"
Application.quit
End If
End Sub