Query

  • Thread starter Thread starter Tom
  • Start date Start date
My record has a serialized (09-001) number and I want to create a query to
find the last record then I will add one to the new record to get my current
record
 
Tom said:
My record has a serialized (09-001) number and I want to create a query to
find the last record then I will add one to the new record to get my current
record

OK. Say your field is named serial_num, and the table is called tblFoo.
You can order descending on serial_num, and retrieve only the Top 1
record.

SELECT TOP 1 serial_num
FROM tblFoo
ORDER BY serial_num DESC;

I made that suggestion because you asked for a query. Another approach
is the DMax() function. So, in a VBA subroutine, you might try:

CurrentMaxSerialNum = DMax("serial_num", "tblFoo")
 
Back
Top