How do I open a form w/ the last record showing first?

  • Thread starter Thread starter forchem
  • Start date Start date
F

forchem

This is probably simple, but I can't seem to figure it out. How do you have
the last record in a table so first when you open a form linked to that table.
 
You can have OnOpen event call a macro action of GoToRecord but how do you
determine which is the last records as Access stores them like a barrel of
bricks, no set order.
Better would be to use FindRecord.
 
This is probably simple, but I can't seem to figure it out.  How do youhave
the last record in a table so first when you open a form linked to that table.

Assuming your table has an autonumber field to generate a unique ID
for each record, base your form on a query that has the records sorted
in descending order by the autonumber field

Steve
 
Since the Access autonumber could be set to a random generation, using the
"largest" autonumber is not a guarantee of finding the "last".

As Karl points out, Access and you don't necessarily have the same
definition of "last"... what's YOUR definition?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
Forchem,

The question that needs answered first is if you want the last entry into
the table or do you want it to default to a blank record?

Next, do you have a Date of entry field available?

Is there any other identifiers of sequencing for the records?

With these answers we can look for logical approches. Right now there are to
many assumptions about your data to proceed.
 
Back
Top