Forums

This topic is locked

Repeat in diffrent colors

Posted 28 Sep 2001 22:42:01
1
has voted
28 Sep 2001 22:42:01 Anton Sutterlueti posted:
How is that effect to do, if i have a repeat from a source, to repeat in colors like this:

1 grey background
2 white background
3 grey background
4 white background

and so on

how can that be done, and it should be sorted by date not by ID number

thanxx allot
ToXiT

Replies

Replied 28 Sep 2001 23:15:00
28 Sep 2001 23:15:00 Owen Eastwick replied:
Try something like this:

<pre id=code><font face=courier size=2 id=code>
&lt;% Counter = 1 %&gt;
&lt;% While ((Repeat1__numRows &lt;&gt; 0) AND (NOT Recordset1.EOF))%&gt;
&lt;%If Counter Mod 2 = 0 Then%&gt;
&lt;tr bgcolor="#C0C0C0" valign="top"&gt;
&lt;td width="50"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(Recordset1.Fields.Item("TextID".Value)%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;td width="150"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(Recordset1.Fields.Item("ItemTitle".Value)%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;td width="500"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%= (Recordset1.Fields.Item("ItemText".Value"%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;% Else %&gt;
&lt;tr bgcolor="#E5E5E5" valign="top"&gt;
&lt;td width="50"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(Recordset1.Fields.Item("TextID".Value)%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;td width="150"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(Recordset1.Fields.Item("ItemTitle".Value)%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;td width="500"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%= (Recordset1.Fields.Item("ItemText".Value)%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;% End If %&gt;
&lt;%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Counter = Counter 1
Wend
%&gt;
</font id=code></pre id=code>

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Edited by - oeastwick on 09/28/2001 23:20:02

Reply to this topic