Finding Last Row in a Table

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

Dan B

Hi;

I have a form named "FrmBeans" and a table
named "TblBeans". The table and form are "hooked up",
everythings working well, BUT if I wanted to
automatically force the data on the form to the last
record in the table, how would the code look? Is there
something like a Forms!Beans.Findlast? :-)

Thanks,
Dan
 
Hi;

I have a form named "FrmBeans" and a table
named "TblBeans". The table and form are "hooked up",
everythings working well, BUT if I wanted to
automatically force the data on the form to the last
record in the table, how would the code look? Is there
something like a Forms!Beans.Findlast? :-)

Thanks,
Dan

There is no "last record" or "first record" in a table, any more than
there's a "last marble" in a bag full of marbles. A table HAS NO
ORDER.

If you have a Query sorting the data in a particular order (say, by a
datestamp or sequential field) you can use the VBA command

DoCmd.GoToRecord acLastRecord

to navigate to the last record in that query's sort order. Just note
that if you don't specify a sort order (i.e. base the form on a Table)
that this record will be essentially unpredicatable.
 
Back
Top