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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing the previous record on a form

Status
Not open for further replies.

Vandelay

Programmer
Jun 22, 2003
95
US
I have a form and I want to reference the previous record's number on the current form

(e.g. "The previous record is number X" to let the user know what this record should be


How do I do this?
 
well in a relational database there is no next/last record, since it all depends on what column you sort bby.

you could use dmax (see faqs/help) that would give you highest number in a given field, you can use dmax +1 to automatically assign the current record the next number in sequence
 
You can use a recordset and sort decending based on record number and return the first record.
But why not use an autonumber data type as the record number? This way you will not have to reference the previous record.

mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top