Web Analytics Made Easy -
StatCounter Need help with Select Case - CodingForum

Announcement

Collapse
No announcement yet.

Need help with Select Case

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help with Select Case

    I am trying to build case that depends on the value of a variable. I have tried using do statement but I receive an Expected statement error. Does anyone know how to do this or know were I can help on this.
    Thanks,
    Ken

    The code

    Select Case catCompany
    Do until compCount = 0
    Case optComp(CompCount) selComp(CompCount)= "SELECTED"
    compCount = compCount -1
    loop
    Case else
    selComp(0) = "SELECTED"
    end Select

  • #2
    You can't put a Do directly into a Select.

    I'm not sure what you're trying to do. Does this do what you want?

    Do until compCount = 0
    If optComp(CompCount) = catCompany then
    selComp(CompCount)= "SELECTED"
    End if
    compCount = compCount -1
    Loop

    Comment


    • #3
      What I am trying to do is create a select that gets the values from an access db. Then I have to compare the values to the records in another table and if they are the same that values has to be selected when the record is opened.

      If I can not put a do into a select then I think the test of my code needs some work. I will go at it a different way and see if I can get it to work. If not I will be back….

      Thanks for the help

      Comment


      • #4
        got it!!

        Thanks for your help.

        Ken

        Comment


        • #5
          Please post your solution for the benefit of others who will encounter the same problem.
          Glenn
          vBulletin Mods That Rock!

          Comment

          Working...
          X