Multiple if statements

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fran7
    New Member
    • Jul 2006
    • 229

    Multiple if statements

    Hi, I have a simple problem. I need three if statements like the following but without the else. Just three simple conditions. is it best to use a case statement instead? Thanks for any help. Also if one needs some custom coding done is it possible to post on the job section?


    Richard

    Code:
    If Session("Authorizationlevel") ="1" then
    bla
    
    If Session("Authorizationlevel") ="2" then
    bla
    
    If Session("Authorizationlevel") ="3" then
    
    bla
    Sorry I worked it out as

    Code:
    If Session("Authorizationlevel") ="1" then
    bla
    Else
    end if
    
    If Session("Authorizationlevel") ="2" then
    bla
    Else
    end if
    If Session("Authorizationlevel") ="3" then
    bla
    Else
    end if
    bla
    with the else.
    Thanks
    Richard
  • GazMathias
    Recognized Expert New Member
    • Oct 2008
    • 228

    #2
    is it best to use a case statement instead?
    I would agree with that, yes.

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      Originally posted by GazMathias
      I would agree with that, yes.
      me too. as long as your logic branches off from a single variable that can have more than two values, you should definitely use a select case.

      Jared

      Comment

      Working...