Get ready for BLACK FRIDAY shopping starting in

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?

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
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.

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"
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:

&lt;%
varPage = 30 ' &lt;== The number of records per page.

RecordsetName_first = ((RecordsetName_first -1) / varPage) + 1

If Round(RecordsetName_total / varPage) &lt; (RecordsetName_total / varPage) Then
varAdd = 1
End If

If RecordsetName_total &lt;= 30 Then
RecordsetName_total = 1
End If

RecordsetName_total = Round((rsRFQs_total / varPage),0) + varAdd
%&gt;


Then I modified the Next Previous etc. Links as follows:

&lt;% If Not RecordsetName.EOF Or Not RecordsetName.BOF Then %&gt;
&lt;br&gt;
&lt;table width="528" border="0" align="center" cellpadding="0" cellspacing="0" class="BlueBorder"&gt;
&lt;tr class="BoldBlue12"&gt;
&lt;td width="50" height="30" align="center"&gt;
&lt;div align="center"&gt;
&lt;% If MM_offset &lt;&gt; 0 Then %&gt;
&lt;a href="&lt;%=MM_moveFirst%&gt;"&gt;&lt;img src="ButtonFirst.gif" alt="First" width="29" height="13" border="0"&gt;&lt;/a&gt;
&lt;% End If ' end MM_offset &lt;&gt; 0 %&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td width="39" align="center"&gt; &lt;div align="left"&gt;
&lt;% If MM_offset &lt;&gt; 0 Then %&gt;
&lt;a href="&lt;%=MM_movePrev%&gt;"&gt;&lt;img src="ButtonPrev.gif" alt="Previous" width="29" height="13" border="0"&gt;&lt;/a&gt;
&lt;% End If ' end MM_offset &lt;&gt; 0 %&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td width="350" align="center"&gt;
&lt;div align="center"&gt;

&lt;% ' This bit creates the page link list: 1 2 3 4 etc. and places square brackets arount the active page like: [5] %&gt;
&lt;%
varCount = 0
While varCount &lt; RecordsetName_total
%&gt;
&lt;a href="ThisPage.asp?&offset=&lt;%= varCount * 30 %&gt;"&gt;
&lt;% If RecordsetName_first = varCount + 1 Then %&gt;
[&lt;%= varCount + 1 %&gt;]
&lt;% Else %&gt;
&lt;%= varCount + 1 %&gt;
&lt;% End If %&gt;
&lt;/a&gt;&nbsp;
&lt;%
varCount = varCount + 1
Wend
%&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td width="39" align="center"&gt; &lt;div align="right"&gt;
&lt;% If Not MM_atTotal Then %&gt;
&lt;a href="&lt;%=MM_moveNext%&gt;"&gt;&lt;img src="ButtonNext.gif" alt="Next" width="29" height="13" border="0"&gt;&lt;/a&gt;
&lt;% End If ' end Not MM_atTotal %&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td width="50" align="center"&gt;
&lt;div align="center"&gt;
&lt;% If Not MM_atTotal Then %&gt;
&lt;a href="&lt;%=MM_moveLast%&gt;"&gt;&lt;img src="ButtonLast.gif" alt="Last" width="29" height="13" border="0"&gt;&lt;/a&gt;
&lt;% End If ' end Not MM_atTotal %&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;% End If ' end Not RecordsetName.EOF Or NOT RecordsetName.BOF %&gt;



This displays the Page 1 of 5 or No Results found if the recordset is empty:

&lt;div align="center" class="BodyStandard"&gt;&lt;br&gt;
&lt;% If Not RecordsetName.EOF Or Not RecordsetName.BOF Then %&gt;
Page &lt;%=(RecordsetName_first)%&gt; of &lt;%=(RecordsetName_total)%&gt;
&lt;% Else %&gt;
No Results found
&lt;% End If %&gt;

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!

Reply to this topic