This question is about asp and databases. Why crosspost to so many unrelated
groups? The most (and arguably, the only) relevant group is .asp.db. I'm
setting the followup-to to .asp.db.
Best practice is to pick one newsgroup to which to post. If you've chosen
the wrong one, usually someone will let you know. Irritating people* by
posting off-topic questions is not a good way to maximize your chances of
getting a reply.
* I'm not one of the irritated people: I'm trying to help you get your
answer to this and to future questions as quickly as possible.
See my response inline:
Simon Gare wrote:
Hi
I need to compare a dynamic field in an asp page to a field in
another table, if there is no match then i would like to chane the
row colour ( see code below).
The problem Im having is that the comparison should be one of many
entries in that db field, at the moment it only compares the first
field in the db.
I don't understand your question. For one thing, you said you needed to
compare a "dynamic field in an asp page" to a "field in another table". In
your code, you compare a field from one recordset to a field in another
recordset.
Please clarify what you mean by "many entries", keeping in mind that
recordsets contain fields and records. Show us some of the data from each
recordset and show us what you want the result to be. I suspect you want to
perform a loop, but I'm really not clear what you want to do in that loop.
Bob b
<tr
<%
Record = Recordset1.Fields.Item("COLL_CITY_TOWN").Value
Record2 = Recordset2.Fields.Item("TOWN").Value
If Record = Record2 Then
strbgcolor="#FFCC66"
Else
strbgcolor="silver"
End If
%>
bgcolor="<%=strbgcolor%>">
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"