Skip to content

Opening a Form to the Last Record

How to have a form open to the last record.

Q:  Manjit Lota writes to ask how he can have a form open to the last record.

A:  There are several ways you can do this.  If you want to use the form for data entry, change the form’s DataEntry property to Yes.  Then it will always open on a new record, and will only show the current data entry session’s records. 

If you want to see all records, but have the form open to the last record, put this line in the form’s Load event procedure:

DoCmd.GoToRecord record:=acLast

 

Alternately, if the form’s record source has an AutoNumber ID field, you could sort it by that field in Descending order so that the highest ID would be first.  To use this method, set the form’s OrderBy property with this string (assuming the ID field is called SiteID):

SiteID DESC

About this author