Microsoft KB Archive/89592

= ACC: DoEvents, SendKeys May Not Be Supported in User-Defined Functions =

Article ID: 89592

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q89592



Moderate: Requires basic macro, coding, and interoperability skills.



SUMMARY
Under certain circumstances, DoEvents and SendKeys are not supported when called by user-defined (custom) functions in Visual Basic for Applications (or Access Basic in versions 1.x and 2.0).



MORE INFORMATION
DoEvents and SendKeys are not supported in user-defined functions in the following situations:


 * When calculating a field in a query.
 * When calculating a control on a form or report.
 * From a Visual Basic (or Access Basic) Fill function for a list box, combo box, or OLE Object field.

The DoEvents statement will not allow messages to be processed in these circumstances; instead, it will immediately return. Thus, any keys sent through SendKeys statements or functions will not be processed until all the computations listed above have been completed and responses have been returned to the user.

