Solved

vba to go to the record on a form with vba on microsoft access 2013

Posted on 2014-02-12
2
720 Views
Last Modified: 2014-02-12
hi

i have some weird problem, when i use vba on form1 for example to add a value on form2.childform and then i use vba to  close form1 and to go to the new value on form2.childform, but in stead it's after closing  form2 -  the focus is  on the first record on form2.childform and not the last (and new) record


there is my code

        Forms!form2.Refresh
        DoEvents
        DoCmd.GoToRecord , , aclast

Open in new window

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
2 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39853033
Not sure I understand the question, but typically you want to record position by passing a flag to a form, then let it position once it's populated it's recordset.

The other is your DoEvents.   It's really not what you want if your trying to let Access/JET catch up on operations.  Instead, use:

dbEngine.Idle   to let JET catch up on record operations

and

.Repaint to force forms to finish any pending operations.

 DoEvents gives up processing time to the OS.  You want to use that when working with OLE automation, external files, etc.   In other words when you want to give time to things outside of Access.

Jim.
0
 

Author Closing Comment

by:bill201
ID: 39853056
thanks a lot for your excellent answer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

710 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