Selecting the Last Record Via Query (Part II)

  • Thread starter Thread starter Nuthin
  • Start date Start date
N

Nuthin

Since hardly anyone re-reads older postings, I'm reposting my issue in the
hopes that others will see it too. The situation I have is this:

I have created a fairly complex database via Access but without using any
SQL programming as I do not know how to program. Everything is Tables,
Queries, Forms, Macros and Reports done by hand. The situation I have been
trying to figure out lately is this: After a new record is created, I want
to be able to e-mail a report of it. I can do it if I prompt for the user
to enter the number of the record (generated by an AutoNumber field) but I
want it to be automatic. Right now, a button on the form starts a Macro
that opens a Report based on a Query. Everything I try puts all records
into the report but I just want the LAST record to be in it.

I had the following suggestion:

Create an aggregate query using 'Max' on the autonumber field will provide
the
last record.

I then responded that since there is no specific "Aggregate" query type, I
assumed he was referring
to turning on the Totals function in a Select query and selecting the Max
function on the Total line of the AutoNumber field. When I do that it
prompts for the number of the record to select which is what I'm trying to
avoid. Does anyone know if I'm incorrectly implementing the suggestion?
Are there any other approaches anyone knows of? Thanks!

Nathan
 
I changed the Query's Top Values property from All to 1 and sorted
Descending. Now the query returns only the last AutoNumber field generated.

Nathan
 
Back
Top