Open at Last Record Edited

  • Thread starter Thread starter Dave
  • Start date Start date
That depends entirely on how you define the "last record edited." In a
relational database, there is no order to the entry of data. Everything is
dumped into a bucket and, if you want to display it in some order, then you
have to use an order by clause. Typically you can determine the "last"
record based on some date/time field.
 
See:
Return to the same record next time form is opened
at:
http://allenbrowne.com/ser-18.html

The article explains how to save the primary key value of the record the
user was viewing when they closed the form, and automatically display that
record again when the form is opened.

If you actually intended to return to the last record edited (not the last
one viewed), add a Date/Time field named (say) UpdatedOn to your table. In
the BeforeUpdate event procedure of the form where edits take place, record
the date and time of the edit like this:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.UpdatedOn = Now()
End Sub
Then you can sort on this field (so it appears first) or find it in the Load
event of your form.
 
Back
Top