Open a Form and Move to Last Record in ADO Recordset

C

CFW

I posted a few weeks ago about my .adp crashing when I used a
non-active x calendar control. It took me weeks to discover that the
line "Me.Recordset.AbsolutePosition = Me.Recordset.RecordCount" in the
Open event of the form was CAUSING it. I still don't know why but when
removed, the .adp doesn't crash.

I then tried "Me.Recordset.MoveLast" and it causes the crash again!
Can anyone explain it or MORE importantly, tell me the best way to
simply display the LAST record in the recordset when the form opens.
My form's recordset comes from a view that is sorted ascending on an
AutoNumber field. I have another field that is auto-sequenced but that
the users can edit so there is never any "skipping" of the sequence
(like there can be with a purely AutoNumber field if records are
deleted). This field they use as a transaction ID and I want the
greatest transaction ID to appear in the form when it opens. I don't
want to just sort the view descending and open the form because then
it's confusing to the users clicking "up" through records using nav
buttons and seeing the transaction ID going down.

TIA for any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top