Opening Recordset Objects Asynchronously

In addition to running queries asynchronously, you can open Recordset objects asynchronously. To do so, specify the dbRunAsync constant for the options argument of the OpenRecordset method. You can then use the Cancel method and the StillExecuting property directly on the Recordset object. For example, if you open a Recordset object asynchronously, and it takes a long time to open because more records are returned than expected, you can give users the option of canceling the operation in order to specify more restrictive criteria that returns fewer records.

If you cancel an OpenRecordset method, the Recordset object becomes invalid and you must reopen it to retrieve a valid Recordset object.

Because moving to the last record in a Recordset object can take a long time, the MoveLast method of a Recordset object supports asynchronous operation. To perform an asynchronous MoveLast operation, use the dbRunAsync constant with the MoveLast method. Be sure to check the StillExecuting property to determine when this operation is complete.