I have a form with code running behind it that updates a table not associated to the form record source. Is there a method to check that the update is complete before closing the form.
You might use a recordset to open an SQL statment to see if a record exists. The Dcount and Dlookup functions may also provide what you need. In any case I think you want the form's OnClose event.
To my knowledge, unless your using [blue]DoEvents[/blue] in your update code, the form will wait for the code to complete. Example . . . you run the following loop:
Code:
[blue] Do
x = x + 1
[green]'DoEvents[/green]
Loop Until x = 10000000[/blue]
Although you click the application or form close button X, the form won't start closing until the code completes.
If you enable DoEvents you'll be able to close, prematurely stopping the code.
As for checking if your update was proper, if you receive no error messages than your update should be intact. [blue]If your code is correct . . . then your update will be correct![/blue]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.