Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

910 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

21 Experts available now in Live!

Get 1:1 Help Now