Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Perth, Western Australia, Australia
    Posts
    487
    Thanks
    75
    Thanked 2 Times in 1 Post

    Error Message (2003)

    Loungers, I have the following code:-

    Select Case pass
    Case "pass1"
    Sheets("employee").Visible = True
    Sheets("Appraiser").Visible = False
    Sheets("Summary Sheet").Visible = False
    Sheets("Charts").Visible = False
    Case "pass2"
    Sheets("Appraiser").Visible = True
    Sheets("employee").Visible = False
    Sheets("Summary Sheet").Visible = False
    Sheets("Charts").Visible = False
    Case "admin"
    Sheets("Appraiser").Visible = True
    Sheets("employee").Visible = True
    Sheets("Summary Sheet").Visible = True
    Sheets("Charts").Visible = True
    Case Else
    Exit Sub
    End Select

    End Sub

    I want to display a message if the password is incorrect. Any ideas

    Regards <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error Message (2003)

    Insert a line

    MsgBox "Password incorrect!", vbExclamation, "You stupid fool"

    between "Case Else" and "Exit Sub". See the online help for MsgBox to find out which arguments you can use for the MsgBox function.

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Error Message (2003)

    Inlude directly after after Case Else something like

    MsgBox "Invalid Passord !!!"

    Andrew C

  4. #4
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Perth, Western Australia, Australia
    Posts
    487
    Thanks
    75
    Thanked 2 Times in 1 Post

    Re: Error Message (2003)

    Hans - Thanks very much

  5. #5
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error Message (2003)

    In addition to what Hans and Andrew have said, I would set the Visible property to xlSheetVeryHidden rather than False. If you set it to False, then the user can use the menu to unhide the sheet.
    Legare Coleman

  6. #6
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Perth, Western Australia, Australia
    Posts
    487
    Thanks
    75
    Thanked 2 Times in 1 Post

    Re: Error Message (2003)

    Andrew - Thanks very much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •