Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Login_txt_Click()
- If IsNull(Me.txtLoginID) Then
- MsgBox "Please enter LoginID", vbInformation, "LoginID Required"
- Me.txtLoginID.SetFocus
- ElseIf IsNull(Me.txtPassword) Then
- MsgBox "Please enter password", vbInformation, "Password Required"
- Me.txtPassword.SetFocus
- Else
- If (IsNull(DLookup("UserName", "Users", "UserName='" & Me.txtLoginID.Value & "'"))) Or _
- (IsNull(DLookup("password", "Users", "Password='" & Me.txtPassword.Value & "'"))) Then
- Else
- MsgBox "LoginID and Password correct"
- DoCmd.OpenForm "mainmenu"
- End If
- If (IsNull(DLookup("UserName", "Users", "UserName ='" & UserName.Value & "'And Password ='" & Password.Value & "'"))) Then
- MsgBox "Incorrect LoginID or Password" 'If the inputs are incorrect or null this message is displayed'
- Else
- UserLevel = DLookup("UserLevel", "Users", "UserName ='" & UserName.Value & "'") 'Setting the UserLevel Variable to the column in the login table'
- DoCmd.Close 'Closing the login windows'
- If UserLevel = "Assessor" Then 'Checking if the User's level is assessor'
- DoCmd.OpenReport "CourseDetails", acViewPreview 'Opening and displaying the CourseDetails'
- DoCmd.Maximize
- ElseIf UserLevel = "Administrator" Then
- DoCmd.OpenForm "Main Menu"
- DoCmd.Maximize
- Else
- DoCmd.OpenForm "Main Menu"
- DoCmd.Maximize
- End If
- End If
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement