Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing for after table is updated

Status
Not open for further replies.

dendic

Programmer
Jan 19, 2003
106
US
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.
 
I'm not sure what you are after...

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.

 
How are ya dendic . . .

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]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top