I feel like a ninny here. Cant figure out how to find the max value of a field in a query... How does a query display the max record based on the primary key... want to isolate the last record created, the one with the max primary key.
It's important, IMO, to distinguish between the Max value in a field in a table, and the record that contains that max.
To get the max value we could run a DMax(), like . . .
Code:
dim id as long
id = DMax("FooID", "tblFoo")
. . . but to get the record that contains the max, I would sort on that field, and take the first record, so . . .
Code:
SELECT TOP 1 * FROM tblFoo ORDER BY FooID DESC;
. . . and to get at that data you'd need to open a recordset. Or save it as a query (which you know will only ever contain one record) and DLookup() it, so if you saved that SQL as qryFoo . . .