Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85

    Question Unanswered: Nesting within case statement

    Dear All

    Can anybody suggest any link or example for nesting within a case statement.

    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    nesting what??? Other Select Cases?

  3. #3
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85
    Yes I mean more case statements in one case statement in an option group.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Select Case MyVal
    Case 1
    Case 2
    Case 3
    Select Case MyVal2
    Case 1
    Case 2
    End Case
    Case 4
    End Case

    And your question was?

  5. #5
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85
    Sorry about confusion in my question.

    Select Case MyVal
    Case 1
    Case1
    Case2
    Case3
    Case 2
    Case1
    Case2
    Case3
    Case 3
    Case1
    Case2
    Case3.....
    End Select

    I hope I have made my question clear. I have treid to use IF statement but for some reason did not work.

  6. #6
    Join Date
    Oct 2003
    Posts
    706
    Originally posted by dbase
    Sorry about confusion in my question.

    Select Case MyVal
    Case 1
    Case1
    Case2
    Case3
    Case 2
    Case1
    Case2
    Case3
    Case 3
    Case1
    Case2
    Case3.....
    End Select

    I hope I have made my question clear. I have treid to use IF statement but for some reason did not work.

    What you would do is to nest the select-case statements:

    Code:
    Select Case var1
      Case 1
        Select Case var2
          Case 1
          ..
        End Select
      Case 2 {of var1...}
        select case...
          ..
        end select
    End Select {of var1}
    [{comments} above are enclosed in {braces}...]
    ChimneySweep(R): fast, automatic
    table repair at a click of the
    mouse! http://www.sundialservices.com

  7. #7
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Boy I hate mixing my languages ...

    End Case
    Sorry about that ... You are quite correct it should be End Select ...

  8. #8
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85

    Thumbs up

    Thanks a lot for your reply.

    I shall try it, hopefully tomorrow.

    Thanks

Posting Permissions

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