How To Move To Last Record in Form

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
 
B

Beetle

Try using the RecordsetClone and Bookmark properties.

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

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