Looping over Select Case possible?

Results 1 to 2 of 2

Thread: Looping over Select Case possible?

  1. #1
    Join Date
    Dec 1969
    Posts
    101

    Default Looping over Select Case possible?

    I&#039d like to use a Select Case statement. The number of cases is dynamic. I&#039m trying both of the following, but in each instance I get "Expected statement" on the word "Case."<BR>----------------------------------------<BR>caseVal = 0 &#039 want to use this to increment Case value<BR>someNum = 10 &#039represents total records<BR>randNum = 5 &#039draws a random number from someNum<BR><BR>Select Case randNum<BR>For x = 1 to someNum<BR> caseVal = caseVal+1<BR> Case caseVal<BR> someVar = "whatever"<BR>Next<BR>End Select<BR>-----------------------<BR>also trying this...<BR><BR>caseVal = 0<BR>someNum = 10<BR>randNum = 5<BR><BR>Select Case randNum<BR>caseVal = 0<BR>Do Until RS.EOF <BR> caseVal = caseVal+1<BR> Case caseVal<BR> someVar = RS("whatever")<BR>RS.MoveNext<BR>Loop<BR>End Select<BR><BR>Any thoughts? Thanks

  2. #2
    Join Date
    Dec 1969
    Posts
    101

    Default Sorry! Didn't mean to post on the Advanced Boa

    Sorry. I know this isn&#039t an advanced question. I reposted on the other board.

Posting Permissions

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