Forums
This topic is locked
Recordset navigation (not default)
Posted 26 Jul 2002 16:33:36
1
has voted
26 Jul 2002 16:33:36 Jon Kerbey posted:
Anyone know how to create a recordset navigation like:PREVIOUS | 1 | 2 | 3 | 4 | 5 | 6 | NEXT
Basically like the recordset navigation on www.google.com
Replies
Replied 29 Jul 2002 10:54:12
29 Jul 2002 10:54:12 Jon Kerbey replied:
*BUMP*
No one has any ideas?
No one has any ideas?
Replied 29 Jul 2002 17:22:25
29 Jul 2002 17:22:25 Jeremy Conn replied:
The <b>Recordset Navigation Suite</b> from BasicUltradev.com is what you want... you can buy it at the link below:
www.basic-ultradev.com/exthelp/DataNavigation/index.asp
(DWMX|IIS5|WXP|ASP/VB)
*Connman21*
www.conncreativemedia.com
www.basic-ultradev.com/exthelp/DataNavigation/index.asp
(DWMX|IIS5|WXP|ASP/VB)
*Connman21*
www.conncreativemedia.com
Replied 29 Jul 2002 18:06:59
29 Jul 2002 18:06:59 Jon Kerbey replied:
Thanks - just what I was looking for.
Does anyone know of any tutorials? It's all very well using extensions, but it's nice to learn how to do it yourself.
Does anyone know of any tutorials? It's all very well using extensions, but it's nice to learn how to do it yourself.
Replied 29 Jul 2002 18:21:50
29 Jul 2002 18:21:50 Dave Thomas replied:
It's easy enough to alter your link to show certain records.
Whereas a normal link would be e.g (../mypage.asp) to navigate a record suite simply add a bite of code onto the link like:
../mypage.asp?offset=10 (this will display the next ten records)
../mypage.asp?offset=20 (this will jump a further ten records....)
Best thing for you to do (if you dont buy the extension) is create some nav bars and then have a look through the code.
"Get the kettle on, time for a brew"
Whereas a normal link would be e.g (../mypage.asp) to navigate a record suite simply add a bite of code onto the link like:
../mypage.asp?offset=10 (this will display the next ten records)
../mypage.asp?offset=20 (this will jump a further ten records....)
Best thing for you to do (if you dont buy the extension) is create some nav bars and then have a look through the code.
"Get the kettle on, time for a brew"
Replied 29 Jul 2002 19:27:54
29 Jul 2002 19:27:54 Owen Eastwick replied:
Here is some code I wrote to give me recordset navigation links like this:
First Previous 1 2 [3] 4 5 6 Next Last
First I applied the stamdard recordset navigation behaviour to my recordset, then added this code after the Ultradev/DWMX generated code:
<%
varPage = 30 ' <== The number of records per page.
RecordsetName_first = ((RecordsetName_first -1) / varPage) + 1
If Round(RecordsetName_total / varPage) < (RecordsetName_total / varPage) Then
varAdd = 1
End If
If RecordsetName_total <= 30 Then
RecordsetName_total = 1
End If
RecordsetName_total = Round((rsRFQs_total / varPage),0) + varAdd
%>
Then I modified the Next Previous etc. Links as follows:
<% If Not RecordsetName.EOF Or Not RecordsetName.BOF Then %>
<br>
<table width="528" border="0" align="center" cellpadding="0" cellspacing="0" class="BlueBorder">
<tr class="BoldBlue12">
<td width="50" height="30" align="center">
<div align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_moveFirst%>"><img src="ButtonFirst.gif" alt="First" width="29" height="13" border="0"></a>
<% End If ' end MM_offset <> 0 %>
</div></td>
<td width="39" align="center"> <div align="left">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_movePrev%>"><img src="ButtonPrev.gif" alt="Previous" width="29" height="13" border="0"></a>
<% End If ' end MM_offset <> 0 %>
</div></td>
<td width="350" align="center">
<div align="center">
<% ' This bit creates the page link list: 1 2 3 4 etc. and places square brackets arount the active page like: [5] %>
<%
varCount = 0
While varCount < RecordsetName_total
%>
<a href="ThisPage.asp?&offset=<%= varCount * 30 %>">
<% If RecordsetName_first = varCount + 1 Then %>
[<%= varCount + 1 %>]
<% Else %>
<%= varCount + 1 %>
<% End If %>
</a>
<%
varCount = varCount + 1
Wend
%>
</div></td>
<td width="39" align="center"> <div align="right">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveNext%>"><img src="ButtonNext.gif" alt="Next" width="29" height="13" border="0"></a>
<% End If ' end Not MM_atTotal %>
</div></td>
<td width="50" align="center">
<div align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveLast%>"><img src="ButtonLast.gif" alt="Last" width="29" height="13" border="0"></a>
<% End If ' end Not MM_atTotal %>
</div></td>
</tr>
</table>
<% End If ' end Not RecordsetName.EOF Or NOT RecordsetName.BOF %>
This displays the Page 1 of 5 or No Results found if the recordset is empty:
<div align="center" class="BodyStandard"><br>
<% If Not RecordsetName.EOF Or Not RecordsetName.BOF Then %>
Page <%=(RecordsetName_first)%> of <%=(RecordsetName_total)%>
<% Else %>
No Results found
<% End If %>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
First Previous 1 2 [3] 4 5 6 Next Last
First I applied the stamdard recordset navigation behaviour to my recordset, then added this code after the Ultradev/DWMX generated code:
<%
varPage = 30 ' <== The number of records per page.
RecordsetName_first = ((RecordsetName_first -1) / varPage) + 1
If Round(RecordsetName_total / varPage) < (RecordsetName_total / varPage) Then
varAdd = 1
End If
If RecordsetName_total <= 30 Then
RecordsetName_total = 1
End If
RecordsetName_total = Round((rsRFQs_total / varPage),0) + varAdd
%>
Then I modified the Next Previous etc. Links as follows:
<% If Not RecordsetName.EOF Or Not RecordsetName.BOF Then %>
<br>
<table width="528" border="0" align="center" cellpadding="0" cellspacing="0" class="BlueBorder">
<tr class="BoldBlue12">
<td width="50" height="30" align="center">
<div align="center">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_moveFirst%>"><img src="ButtonFirst.gif" alt="First" width="29" height="13" border="0"></a>
<% End If ' end MM_offset <> 0 %>
</div></td>
<td width="39" align="center"> <div align="left">
<% If MM_offset <> 0 Then %>
<a href="<%=MM_movePrev%>"><img src="ButtonPrev.gif" alt="Previous" width="29" height="13" border="0"></a>
<% End If ' end MM_offset <> 0 %>
</div></td>
<td width="350" align="center">
<div align="center">
<% ' This bit creates the page link list: 1 2 3 4 etc. and places square brackets arount the active page like: [5] %>
<%
varCount = 0
While varCount < RecordsetName_total
%>
<a href="ThisPage.asp?&offset=<%= varCount * 30 %>">
<% If RecordsetName_first = varCount + 1 Then %>
[<%= varCount + 1 %>]
<% Else %>
<%= varCount + 1 %>
<% End If %>
</a>
<%
varCount = varCount + 1
Wend
%>
</div></td>
<td width="39" align="center"> <div align="right">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveNext%>"><img src="ButtonNext.gif" alt="Next" width="29" height="13" border="0"></a>
<% End If ' end Not MM_atTotal %>
</div></td>
<td width="50" align="center">
<div align="center">
<% If Not MM_atTotal Then %>
<a href="<%=MM_moveLast%>"><img src="ButtonLast.gif" alt="Last" width="29" height="13" border="0"></a>
<% End If ' end Not MM_atTotal %>
</div></td>
</tr>
</table>
<% End If ' end Not RecordsetName.EOF Or NOT RecordsetName.BOF %>
This displays the Page 1 of 5 or No Results found if the recordset is empty:
<div align="center" class="BodyStandard"><br>
<% If Not RecordsetName.EOF Or Not RecordsetName.BOF Then %>
Page <%=(RecordsetName_first)%> of <%=(RecordsetName_total)%>
<% Else %>
No Results found
<% End If %>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 30 Jul 2002 09:38:35
30 Jul 2002 09:38:35 Jon Kerbey replied:
That's brilliant, thanks very much for your help!