How To Move To Last Record in Form

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

I have a form which is bounded to a table. I have a button on the form
which will add 7 addition records to the table and update the table of the
form. After clicking on the button to add the 7 records, the number of
records increase by 7 in the form.

That works - no issue. The problem I have is after clicking on the button
and when it completes, the record on the form resets back to the 1st record.
I would like to advance to to the last record.

I have tried the following:

1) DoCmd GoToRecord , , ac_Last This will work on the "On Activate"
event. When the form opens it will be at the last record of the table in the
form.

It doesn't work if add that in the button VBA code at the end.

2) If I add the "DoCmd GoToRecord , , ac_last" to a text box in the "got
focus" even, it will move to the last record.

I need help to move the last record after click on my button.

Can someone help ?

Thanks,

Gary

P.S. Using Access 2000-03 with XP Pro OS
 
Try using the RecordsetClone and Bookmark properties.

With Me.RecordsetClone
.MoveLast
Me.Bookmark = .Bookmark
End With
 
Back
Top