Select Case - Repeat Region

Author Message
JBarbea1

  • Total Posts : 20
  • Scores: 0
  • Reward points : 0
  • Joined: 3/27/2007
  • Status: offline
Select Case - Repeat Region Saturday, October 20, 2007 9:46 AM (permalink)
0
Hey guys, Im a little stuck.  Im working with VBScript, SQL, and ASP

Im trying use a select case dynamically.  I have a list of names in a recordset (rsInstructorsList) and I want to select the case (instructors name) where the case is equal to the ID number (which comes from another recordset, and is set when the row from the data base is created)

The error I recieve is this:
Microsoft VBScript compilation error '800a0400'
Expected statement
/Instructor/ride_times/identify.asp, line 241
Case (rsInstructorsList.Fields.Item("Instructor_ID").Value)
^
My Code is this:
<% ' Case Select for Identifying Instructor only by the ID
dim srtInstructorID
dim setInstructorID

strInstructorID = setInstructorID

Select Case strInstructorID

While ((Repeat17__numRows <> 0) AND (NOT rsInstructorsList.EOF))

    Case (rsInstructorsList.Fields.Item("Instructor_ID").Value)
        Response.Write((rsInstructorsList.Fields.Item("L_Name").Value) & "&nbsp;" (rsInstructorsList.Fields.Item("F_Name").Value))

Repeat17__index=Repeat17__index+1
  Repeat17__numRows=Repeat17__numRows-1
  rsInstructorsList.MoveNext()
Wend
rsInstructorsList.Requery()

Case Else
    Response.Write("Unknown Instructor ID")
End Select
%>

Anyone ever try this before?  Im lost, I think, or its Sat and I am working and Im fried


 
#1
    webber123456

    • Total Posts : 58
    • Scores: 0
    • Reward points : 0
    • Joined: 9/20/2007
    • Status: offline
    RE: Select Case - Repeat Region Sunday, October 21, 2007 5:18 AM (permalink)
    0
    you have a "case" inside a "while' loop which is not allowed. 

    VBscript expects to see "wend" statement before finding the next "Case" option
     
    #2
      JBarbea1

      • Total Posts : 20
      • Scores: 0
      • Reward points : 0
      • Joined: 3/27/2007
      • Status: offline
      RE: Select Case - Repeat Region Sunday, October 21, 2007 11:56 PM (permalink)
      0
      How can I preform this function?

      I'd like to be able to repeat a case selection until a recordset is empty.
       
      #3
        webber123456

        • Total Posts : 58
        • Scores: 0
        • Reward points : 0
        • Joined: 9/20/2007
        • Status: offline
        RE: Select Case - Repeat Region Monday, October 22, 2007 4:18 AM (permalink)
        0
        you wil probably need another separate select case function inside the While loop.
         
        #4
          shakir

          • Total Posts : 1
          • Scores: 0
          • Reward points : 0
          • Joined: 11/7/2007
          • Status: offline
          RE: Select Case - Repeat Region Wednesday, November 07, 2007 4:54 AM (permalink)
          0
          Your Case statement is wrong , Cant put inside loop has to type Case 1, case2, etc
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9