First, stream your recordset into an array with GetRows().
That's the only
way you can have true random access of the data without
having horrid
performance. Then it's a simple matter of checking the
values. Below, I've
decided that I called the array MyData and that I've stored
the UBound of
the array in a variable called MAX_ROW. Obviously, you can
call them
whatever you want. I also stored all my field indexes in
variables so I
don't have to remember them (ex: I_ID = 0, I_Name=1, etc.)
<%
For X = 0 to MAX_ROW
CellColor = "white"
If X > 0 Then
If MyData(I_SecValue,X) = MyData(I_SecValue,X-1) Then
CellColor = "yellow"
End If
ElseIf X < MAX_ROW
If MyData(I_SecValue,X) = MyData(I_SecValue,X+1) Then
CellColor = "yellow"
End If
End If
%>
<tr>
<td><%=MyData(I_ID,X)%></td>
<td
style="background-color:<%=CellColor%>"><%=MyData(I_SecValue,X)%></td>
</tr>
<%
Next
%>
"jamesy" <mtm81@hotmail.com> wrote in message
news:e4s6ja$cs8$1@forums.macromedia.com...
> Hi,
> I've got a bit of brain freeze with the following:
> looping through a tbl which holds an ID value and a
secondary value for
> each
> unique ID.
> I've tried working it out based on the checking agianst
the nextrecord and
> the
> previous but my code became too complicated...