If you're still using the ID field, or an equivalent field using default.count, you can do it.
You can increment or decrement the value of $rec{'ID'}, but you get a problem then when you're at the first or last records in the database. To get around that, you check to see if it's the first (first will obviously be 1) or the last (which will be the number in default.count).
Here's how I did it, you might have to modify if to suit your setup:
Code:
open(ID,"$db_id_file_name") or &die("Can't open count file");
$count = <ID>;
close(ID);
$first = 1;
$last = $count;
$id = $rec{'ID'};
if ($id == $first) {$back = $last;}
else {$back = $id--;}
if ($id == $last) {$fwd = 1;}
else {$fwd = $id++;}
Now you have the following variables to use for your navigation buttons:
$first # Obviously 1, the first record in the DB
$last # The value of $count, the last record
$back # Back one record
$fwd # Forward one record
And you'd use them in your record_long call, replacing ID=$rec{'ID'} with ID=$next or $ID=$last.
There's an example here
irishfineart.com/bin/db/?view=view&rid=6 Cheers,
adam
ps. I can't get at Carol's website at the moment to check where you should put it, but as far as I remember the subroutine is called html_record_long, and this snippet should be placed just after "my (%rec) = @_;".
[This message has been edited by dahamsta (edited April 25, 1999).]