Solved

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

Posted on 2013-06-12
3
762 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Assisted Solution

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

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

717 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