473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Synchronize DoCmd processing with VBA execution

11
I understand Access lets the VBA statements following a DoCmd statement execute before a DoCmd has completed. I have a situation where I use a DoCmd.DoMenuItem (copied from the UNDO button VBA) to cancel an ADD operation (new empty record already created for the bound form) and then make changes to the RecordSource for my form. So, I want to wait for the DoCmd.DoMenuItem to complete. How do I do it?

Being somewhat of a newbie, I only know how to synchronize with a pop-up form, but it's not an option here. Too intrusive.
Sep 9 '08 #1
3 1990
missinglinq
3,532 Expert 2GB
Try placing the line

DoEvents

between the two commands.

Linq ;0)>
Sep 10 '08 #2
cm5th
11
Try placing the line

DoEvents

between the two commands.

Linq ;0)>
I looked up DoEvents, did what you suggested and it worked. Apparently DoEvent uses Windows services. Thanks!
Sep 10 '08 #3
missinglinq
3,532 Expert 2GB
That's correct! DoEvents basically relinquishes control to Windows until the current event is concluded then returns control to Access to carryout the next task. It's a good bet when timing appears to be the problem.

Glad we could help!

Linq ;0)>
Sep 10 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Thomas Rademacher | last post by:
Hallo, I want to synchronize the main function of my script. I havn't a class structure in my script. def main(): # my code to synchronized if __name__=='__main__': main()
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
15
by: Thelma Lubkin | last post by:
formA determines some_where and some_value and issues docmd.close ,Me docmd.openform "formB", , ,some_where, , ,some_value formB receives the correct some_where and some_value After...
2
by: Mike | last post by:
I am trying to open a search results form based on the input from a prompt form. I am using the following code: --- Begin Code --- Private Sub btnSearch_Click() 'Dim Variable and assign data...
1
by: taleran58 | last post by:
Hi all. I'm writting a multithreading program that will update a loacal Access database. I'm using OleDB connection to get access to the database from each thread and my question is: how do I...
1
by: sfeher | last post by:
Hi All, I need to synchronize on multiple event notifications. After loading a number of scripts in my page ( using document.createElement('script') / appendChild ) I get a notification for...
14
by: Dave Booker | last post by:
I'm doing some analysis that is readily broken up into many independent pieces, on a multicore machine. I thought it would be best to just queue like 1000 of these pieces in the ThreadPool, and...
9
by: Jay | last post by:
How do I stop execution of remaining sub procesures in a multithreaded app? For example: sub form_load dim i as integer for i = 1 to 5 '5 threads dim ts as threadstart(addressof...
3
by: schaermu | last post by:
Hi there we noticed a rather strange behavior in one of our web applications. When debugging it on a local developer workstation, everything is processed fine (using Cassini Developement...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.