Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 18th, 2004, 01:05 PM
m@ggi3 m@ggi3 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 4 m@ggi3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Looping through a recordset using an array

What I have is a recordset listing out a group of names. I've retrieved the field that lists the id numbers for the array and split them to a list. Then I want it to loop through the names listing trying to highlight the ids that need to be hightlighted. What I am getting is my list repeats the names according to how many ids are in the array. So if I have 2 numbers in the array I see every name on the list twice and the two that I need selected.

I want the list to show the names one time with the correct names selected. What is wrong with this code?


thealtselect = RSRetrieve("POC2")
thePOC2 = split(thealtselect,", ")
POCSelect2 = ""


Response.Write "<OPTION value=0>Vacant"
Do Until RSPOC2.eof

For i=0 to ubound(thePOC2)

If Trim(int(RSPOC2("DivID"))) = TRIM(thePOC2(i)) Then

POCSelect2 = " Selected"

Else

POCSelect2 = ""

End If

Response.Write "<OPTION VALUE=" & RSPOC2("DivID") & POCSelect2 & "> " & TRIM(RSPOC2("LastName"))& ", " & TRIM(RSPOC2("FirstName")) &vbcrlf

Next



RSPOC2.MoveNext

Loop



Thanks.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Looping through a recordset using an array


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway