Forums
This topic is locked
3 repeating regions on one page
Posted 16 May 2003 00:10:02
1
has voted
16 May 2003 00:10:02 Tom Winter posted:
Is it possible to use three repeating regions from the same recordset on one page? I have three cells and I need records 1-5 in one cell, records 6-10 in cell number two, and records 11-15 in cell number three. I've been able to easily get the 1-5 records in the repeating region of the first cell. But I'm stumped on how to get the next 10 records in the next two cells. Any suggestions, DW geniuses... Replies
Replied 17 May 2003 01:07:17
17 May 2003 01:07:17 Phil Shevlin replied:
I'm no genius. And I don't know your table structure but this might help.
Basically, I'm not using multiple repeat regions. I am merely telling the loop to do something different every fifth loop. You should get the idea.
<pre id=code><font face=courier size=2 id=code>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 15 ' SET THIS TO 15 ROWS
Repeat1__index = 0
rs_numRows = rs_numRows + Repeat1__numRows
%>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<% While ((Repeat1__numRows <> 0) AND (NOT rs.EOF)) %>
<%=(rs.Fields.Item("UserID"
.Value)%><br>
<%=(rs.Fields.Item("CompanyName"
.Value)%><br><br>
<%
RecordCounter = RecordCounter + 1
If RecordCounter Mod 5 = 0 Then ' IF THE COUNTER IS DIVISIBLE BY 5
' END THE ROW AND START A NEW ONE
Response.Write "</td></tr><tr><td>"
Else
Response.Write ""
End If
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs.MoveNext()
Wend
%>
</table></font id=code></pre id=code>
Edited by - wdglide on 17 May 2003 01:08:45
Edited by - wdglide on 17 May 2003 01:10:34
Basically, I'm not using multiple repeat regions. I am merely telling the loop to do something different every fifth loop. You should get the idea.
<pre id=code><font face=courier size=2 id=code>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 15 ' SET THIS TO 15 ROWS
Repeat1__index = 0
rs_numRows = rs_numRows + Repeat1__numRows
%>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<% While ((Repeat1__numRows <> 0) AND (NOT rs.EOF)) %>
<%=(rs.Fields.Item("UserID"

<%=(rs.Fields.Item("CompanyName"

<%
RecordCounter = RecordCounter + 1
If RecordCounter Mod 5 = 0 Then ' IF THE COUNTER IS DIVISIBLE BY 5
' END THE ROW AND START A NEW ONE
Response.Write "</td></tr><tr><td>"
Else
Response.Write ""
End If
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs.MoveNext()
Wend
%>
</table></font id=code></pre id=code>
Edited by - wdglide on 17 May 2003 01:08:45
Edited by - wdglide on 17 May 2003 01:10:34