find last record in table

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I have a form and I want to put a command button on the
form to find the last bank # in this table can i do
this using a macro? if so what actions would i use?
 
You may want to try the DMax function in the Click event of the button.

intLastBankNumber = DMax("[BankNumbers]", "tblTableName")

This will give you the largest number in the field [BankNumbers] in the
table tblTableName.
 
I have a form and I want to put a command button on the
form to find the last bank # in this table can i do
this using a macro? if so what actions would i use?

A Table is an unordered "bag" of data. There is no first record, there
is no last record.

However, if [Bank #] is a field in the table with unique and
sequential values, you can use a Query with a criterion on [Bank #] of

=DMax("[Bank #]", "[yourtablename]")

to retrieve the record with the largest value of Bank #.
 
Back
Top