PDA

View Full Version : previous/next button-msaccess-problem


rdh_mu
06-02-2003, 01:18 PM
I have an Access database whose current purpose is to be an image gallery.

How do I get better control over the next and previous buttons?
I want to compare the Rs("school").value recordset, which is the name of a shool, with the name of the school in the recordset right after it in the database.

If the two school names are the same then I want the user to hyperlink to the next recordset. However, if the two school names are different I do not want them to advance to the next recordset.



<table cellpadding=2>
<tr><th width="50%" colspan="3"></th></tr>
<tr> <td><div align="center">
<%if iPageCurrent > 1 then%>
<a href="gallery-e.asp?pageNumber=<%=iPageCurrent - 1%>">Previous Page</a>
<%else%>
<span class="submenutitles">Previous Page</a>
<%end if%>
</div></td>


<td><div align="center">
<%if Rs("school").value <> Rs("school").value then%>
<span class="submenutitles">Next Page</a>
<%else%>
<a href="gallery-e.asp?pageNumber=<%=iPageCurrent + 1%>">Next Page</a>
<%end if%>
<%else%>
<a href="gallery-e.asp">Next Page</a>
<%end if%>
</td></div>
</tr>
</table>

freaK
06-03-2003, 01:37 AM
Originally posted by rdh_mu

I want to compare the Rs("school").value recordset, which is the name of a shool, with the name of the school in the recordset right after it in the database.


The best way would be to use an array. This way it would be easy to compare the values just before and just after the current position. I'd recommend using The GetRows() function which inserts the entire recordset into an array which can be disconnected and easily manipulated.

If you're unfamiliar with GetRows() then check into it or let me know and I'll provide an example.