[AccessD] DoEvents - How should this command be used in Access?

Jim Lawrence accessd at shaw.ca
Tue May 22 21:14:06 CDT 2007


Hi Dan:

Off hand you could use it to stop a function or subroutine from proceeding
to end of its code when starting another process like opening a form. It
pauses the caller routine. Example:

...
gbCalendarFlag = True
DoCmd.OpenForm "RECalendar"

Do While gbCalendarFlag = True
   DoEvents
Loop

... ' Save the date selected.

The above code spawns a calendar form and then waits at that position in the
code until the public variable 'gbCalendarFlag' changes from initial setting
of TRUE. This is changed within the 'RECalendar' form when clicking the EXIT
button. 

It is very handy and can not be managed any other way except with more code.

HTH

Jim  

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Tuesday, May 22, 2007 5:48 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] DoEvents - How should this command be used in Access?

Hello to everyone!

Where would it be useful to use the DoEvents command be used in an Access
application?  

Thanks!
Dan Waters

-- 
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