Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Previous" and "Next" buttons? 2

Status
Not open for further replies.

jisoo22

Programmer
Apr 30, 2001
277
US
Hi all,

This sounds pretty easy but I'm not sure how to do it. I'm trying to use Ultradev to create an ASP that will pull up records and enable the user to update records as well as view others. So far, I've created the form and form fields, created a recordset, an update record, and dynamic text fields. My understanding is that this will pick up the last record entered and display it. Now what I need is to make two buttons, a "next" and a "previous" button that will pick up the next and previous records when clicked. Can someone tell me how to do that?

Thanks,
Jisoo22
 
Open the server behaviours click the + button and then follow the move to record for previous or next records, failing that do the tutorial.. :) I dont want to go to Chelsea!!!
 
Hi there,

By the sounds of things you need to have the next and prev buttons already containing the link to the next & prev records.

If you know the current precord you're e.g. the Index of the record = 23, then you should be able to figure out that next = 24 and prev = 22.

The example below shows if the user is an authorised user then show the button, and creates the ASP link to the page.

<%IF Session(&quot;MM_UserAuthorization&quot;) = &quot;Admin&quot; THEN %>
<%dim strEditMovie
strEditMovie = &quot;'admin_movie_edit.asp?Index=&quot; & rsDetail.Fields.Item(&quot;Index&quot;).Value &&quot;';&quot;
%>
<input type=&quot;button&quot; onClick=&quot;location = <%=strEditMovie%>&quot; value=&quot;Edit Movie&quot; name=&quot;button22&quot;>
<%END IF%>

When the server executes the ASP you don't see all the VBScript stuff only

<input type=&quot;button&quot; onClick=&quot;location = 'admin_movie_edit.asp?Index=22';&quot; value=&quot;Edit Movie&quot; name=&quot;button22&quot;>

When I press the button I will be taken to the page with the Index=22, or Index=24

Hope this helps

Trevor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top