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

Stuart McLachlan stuart at lexacorp.com.pg
Thu Nov 3 17:12:23 CDT 2016


One is a sbuseet of the other.

When you use DoEvents, everything else currently queued gets done, then Sleep 0 is called.

When you use Sleep 0 there is no guarantee that all VBA events in the queue will be 
completed,


Good article here on the overhead of DoEvents:

http://www.fmsinc.com/microsoftaccess/modules/examples/avoiddoevents.asp

But for advantages of using it, see here:

http://analystcave.com/vba-sleep-vs-wait/



On 3 Nov 2016 at 12:22, Jim Dettman wrote:

> 
> Yes and no.
> 
> DoEvent yields the processing time to the OS, but your code remains
> active.
> 
> Sleep on the other hand tells the OS to put the process on to sleep
> for that amount of time, and nothing executes.   When the sleep is
> over, you'll be on the next line of code.
> 
> No need to be used together; when you sleep, everything else gets
> time.
> 
> Jim.
> 
> -----Original Message-----
> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf
> Of Mark Simms Sent: Thursday, November 03, 2016 11:11 AM To: 'Access
> Developers discussion and problem solving' 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
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list