Solved

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

Posted on 2014-02-12
2
727 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 58

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

617 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