Solved

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

Posted on 2013-06-12
3
759 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 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…

732 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