Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Compare Database
- Private Sub Command1_Click()
- Dim UserLevel As String
- 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
- 'process the job
- If (IsNull(DLookup("UserName", "Users", "UserName ='" & Me.txtLoginID.Value & "'"))) Or _
- (IsNull(DLookup("Password", "Users", "Password ='" & Me.txtPassword.Value & "'"))) Then
- MsgBox "Incorrect LoginID or Password"
- Else
- DoCmd.Close acForm, "Login"
- UserLevel = DLookup("UserLevel", "Users", "UserName ='" & UserName.Value & "'")
- 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 = "Owner" Then
- DoCmd.OpenForm "mainmenu"
- DoCmd.Maximize
- ElseIf UserLevel = "Administrator" Then
- DoCmd.OpenForm "mainmenu"
- DoCmd.Maximize
- ElseIf UserLevel = "Guest" Then
- DoCmd.OpenForm "mainmenu"
- DoCmd.Maximize
- Else
- DoCmd.OpenForm "mainmenu"
- DoCmd.Maximize
- End If
- End If
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement