ACC: DoEvents, SendKeys May Not Be Supported in User-Defined Functions (89592)



The information in this article applies to:

  • Microsoft Access 1.0
  • Microsoft Access 1.1
  • Microsoft Access 2.0
  • Microsoft Access for Windows 95 7.0
  • Microsoft Access 97

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.

REFERENCES

For more information about DoEvents, search the Help Index for "DoEvents."

For more information about SendKeys, search the Help Index for "SendKeys Statement."

Modification Type:MajorLast Reviewed:5/9/2003
Keywords:kbinfo kbProgramming KB89592