Solved

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

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Failed implementation Access runtime application 14 26
Help with SQl and UNION 3 19
Syntax using Declare 3 16
SQL Query 2 0
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Read about achieving the basic levels of HRIS security in the workplace.
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…
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…

744 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

14 Experts available now in Live!

Get 1:1 Help Now