[AccessD] Access Has Stopped Working! (Working Solution)

Bob Walsh BWalsh at healthinsight.org
Thu Nov 3 10:25:32 CDT 2016


The DoEvents function returns an Integer representing the number of open forms in stand-alone versions of Visual Basic, such as Visual Basic, Professional Edition. DoEvents returns zero in all other applications.

DoEvents passes control to the operating system. Control is returned after the operating system has finished processing the events in its queue and all keys in the SendKeys queue have been sent.

DoEvents is most useful for simple things like allowing a user to cancel a process after it has started, for example a search for a file. For long-running processes, yielding the processor is better accomplished by using a Timer or delegating the task to an ActiveX EXE component. In the latter case, the task can continue completely independent of your application, and the operating system takes care of multitasking and time slicing.

Any time you temporarily yield the processor within an event procedure, make sure the procedure is not executed again from a different part of your code before the first call returns; this could cause unpredictable results. In addition, do not use DoEvents if other applications could possibly interact with your procedure in unforeseen ways during the time you have yielded control.

Bob Walsh
Senior Database Analyst
(503) 382-3993


-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark Simms
Sent: Thursday, November 03, 2016 8:11 AM
To: 'Access Developers discussion and problem solving' <accessd at databaseadvisors.com>
Subject: Re: [AccessD] Access Has Stopped Working! (Working Solution)

Does the Sleep API function provide the same functionality as the DoEvents loop ?

Or should they be used together ?

DoEvents
Sleep 500 ' Wait 1/2 second



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

________________________________
HealthInsight is a private, nonprofit, community-based organization dedicated to improving health and health care, with offices in four western states: Nevada, New Mexico, Oregon and Utah. HealthInsight also has operations in Seattle, Wash., and Glendale, Calif., supporting End-Stage Renal Disease Networks in the Western United States. The information and any materials included in this transmission may contain confidential information from HealthInsight. The information is intended for use by the person named on this transmittal. If you are not the intended recipient, be aware that any disclosure, copying, distribution, or use of the contents of this transmission is prohibited. If you have received this message in error, please inform the sender and delete all copies.



More information about the AccessD mailing list