how can i open one form from another and go to the last record on access 2013


how can i open one form in antoehr form and go to the last record in the new opened form

something like this form "SampleForm"
Who is Participating?
Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
Typically, DoCmd operations work on the "current object". That may or may not be "SampleForm" (although in most cases it will).

To insure that you're working with the correct form, you can do this:

DoCmd.OpenForm "SampleForm"
Dim rst As New DAO.Recordset

Set rst = Forms("SampleForm").RecordsetClone

If Not (rst.EOF And Not rst.BOF) Then
  Forms("SampleForm").Bookmark = rst.Bookmark
End If
als315Connect With a Mentor Commented:
Have you tested:
DoCmd.OpenForm "SampleForm"
DoCmd.GoToRecord , , acLast
bill201Author Commented:
Thanks a lot, both solutions are excellent
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.