| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Looping through a recordset using an array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|