Solved

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

Posted on 2013-06-12
3
727 Views
Last Modified: 2013-06-12
hi

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

something like this

docmd.open form "SampleForm"
docmd.GoToRecord,,acNewRec
0
Comment
Question by:bill201
3 Comments
 
LVL 39

Assisted Solution

by:als315
als315 earned 250 total points
ID: 39240331
Have you tested:
DoCmd.OpenForm "SampleForm"
DoCmd.GoToRecord , , acLast
?
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 39241470
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
  rst.MoveLast
  Forms("SampleForm").Bookmark = rst.Bookmark
End If
0
 

Author Closing Comment

by:bill201
ID: 39242839
Thanks a lot, both solutions are excellent
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now