mình có 1 form đăng nhập ,với 2 ô textbox tên đăng nhập và pass
mình muốn với tên đăng nhâp và pass này menu sẽ hiện đầy đủ
với tên đăng nhâp và pass word khác nó sẽ ẩn một số phần trong menu
hiện mình có 1 bảng lưu trữ usename và pass
code nút đăng nhập
Private Sub cmdDangNhap_Click()
If IsNull(Me.cboUserID) Or Me.cboUserID = "" Then
msgBoxOK DLookup("[NoiDung1]", "tblThongBao", "[SoTB] = 1"), vbCritical, DLookup("[TieuDe]", "tblThongBao", "[SoTB] = 1")
Me.cboUserID.SetFocus
Exit Sub
End If
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
msgBoxOK DLookup("[NoiDung2]", "tblThongBao", "[SoTB] = 1"), vbCritical, DLookup("[TieuDe]", "tblThongBao", "[SoTB] = 1")
Me.txtPassword.SetFocus
Exit Sub
End If
If Me.txtPassword.Value = Me.txtPasstemp Then
USERNAME = Me.txtUserName.Value
USERID = Me.cboUserID.Value
UserLevel = Me.txtUserLevel.Value
UserPASS = Me.txtPassword.Value
DoCmd.Close
DoCmd.OpenForm "main"
Else
msgBoxOK DLookup("[NoiDung1]", "tblThongBao", "[SoTB] = 2"), vbCritical, DLookup("[TieuDe]", "tblThongBao", "[SoTB] = 2")
Me.txtPassword.SetFocus
End If
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
msgBoxOK DLookup("[NoiDung2]", "tblThongBao", "[SoTB] = 2"), vbCritical, DLookup("[TieuDe]", "tblThongBao", "[SoTB] = 2")
Application.Quit
End If
End Sub
mình muốn với tên đăng nhâp và pass này menu sẽ hiện đầy đủ
với tên đăng nhâp và pass word khác nó sẽ ẩn một số phần trong menu
hiện mình có 1 bảng lưu trữ usename và pass
You must be registered for see links
code nút đăng nhập
Private Sub cmdDangNhap_Click()
If IsNull(Me.cboUserID) Or Me.cboUserID = "" Then
msgBoxOK DLookup("[NoiDung1]", "tblThongBao", "[SoTB] = 1"), vbCritical, DLookup("[TieuDe]", "tblThongBao", "[SoTB] = 1")
Me.cboUserID.SetFocus
Exit Sub
End If
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
msgBoxOK DLookup("[NoiDung2]", "tblThongBao", "[SoTB] = 1"), vbCritical, DLookup("[TieuDe]", "tblThongBao", "[SoTB] = 1")
Me.txtPassword.SetFocus
Exit Sub
End If
If Me.txtPassword.Value = Me.txtPasstemp Then
USERNAME = Me.txtUserName.Value
USERID = Me.cboUserID.Value
UserLevel = Me.txtUserLevel.Value
UserPASS = Me.txtPassword.Value
DoCmd.Close
DoCmd.OpenForm "main"
Else
msgBoxOK DLookup("[NoiDung1]", "tblThongBao", "[SoTB] = 2"), vbCritical, DLookup("[TieuDe]", "tblThongBao", "[SoTB] = 2")
Me.txtPassword.SetFocus
End If
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
msgBoxOK DLookup("[NoiDung2]", "tblThongBao", "[SoTB] = 2"), vbCritical, DLookup("[TieuDe]", "tblThongBao", "[SoTB] = 2")
Application.Quit
End If
End Sub