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

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.
 
K

KARL DEWEY

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.
 
S

Steve

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
 
J

Jeff Boyce

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.
 
W

Weebl

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top