Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Select Case - Repeat Region

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,52863
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Select Case - Repeat Region
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Select Case - Repeat Region - 10/20/2007 8:46:40 AM   
  JBarbea1

 

Posts: 20
Score: 0
Joined: 3/27/2007
Status: offline
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
 
 
Post #: 1
 
 RE: Select Case - Repeat Region - 10/21/2007 4:18:19 AM   
  webber123456

 

Posts: 34
Score: 0
Joined: 9/20/2007
Status: offline
you have a "case" inside a "while' loop which is not allowed. 

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

(in reply to JBarbea1)
 
 
Post #: 2
 
 RE: Select Case - Repeat Region - 10/21/2007 10:56:17 PM   
  JBarbea1

 

Posts: 20
Score: 0
Joined: 3/27/2007
Status: offline
How can I preform this function?

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

(in reply to webber123456)
 
 
Post #: 3
 
 RE: Select Case - Repeat Region - 10/22/2007 3:18:55 AM   
  webber123456

 

Posts: 34
Score: 0
Joined: 9/20/2007
Status: offline
you wil probably need another separate select case function inside the While loop.

(in reply to JBarbea1)
 
 
Post #: 4
 
 RE: Select Case - Repeat Region - 11/7/2007 3:54:08 AM   
  shakir

 

Posts: 1
Score: 0
Joined: 11/7/2007
Status: offline
Your Case statement is wrong , Cant put inside loop has to type Case 1, case2, etc

_____________________________

security software

(in reply to JBarbea1)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Select Case - Repeat Region Page: [1]
Jump to:





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
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts