Forums

This topic is locked

Records displayed in repeat region

Posted 07 Jan 2003 21:29:20
1
has voted
07 Jan 2003 21:29:20 George Cherian posted:
What I am trying to do is to display all the records in the recordset in a single page initially and then the user can select the number to be displayed in a pge from a drop down list box - containing values ALL, 5, 10, 25 etc.

Can someone help me with this...

Edited by - gc2350 on 07 Jan 2003 21:31:29

Replies

Replied 08 Jan 2003 13:01:19
08 Jan 2003 13:01:19 Owen Eastwick replied:
Create a means for the user to select the number of rows to display, perhaps a list/menu:


<% varSeleceted = CStr(varRows) %>
<select name="selRows">
<option value="10" <% If varSelected = "10" Then Response.Write("seleceted" %>>10</option>
<option value="20" <% If varSelected = "20" Then Response.Write("seleceted" %>>20</option>
<option value="30" <% If varSelected = "30" Then Response.Write("seleceted" %>>30</option>
</select>

Place this with in a form and have it submit back to the same page.


At the beginning of the VBScript portion of the page collect the Option value selected and store it in a variabe, give a default value for when the page is first opened:

<%
varRows = Request("selRows"
If varRows = "" Then varRows = 10 ' <----- Default Value
%>


Now look for the Repeat code in the VBScript, and modify the <b>Repeat1__numRows = </b> line to use the variable.

&lt;%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = varRows ' <font color=red>&lt;------ MODIFY THIS LINE</font id=red>
Repeat1__index = 0
RecordsetName_numRows = RecordsetName_numRows + Repeat1__numRows
%&gt;
&lt;%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
etc......




Regards

Owen.

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

Reply to this topic