Allen Browne wrote:
Correct: the Unload event can cancel the closing of the form.
That's too late to validate the data though.
The record has already been saved at this point.
Use the BeforeUpdate event of the *form* (not controls).
That's the last event before the data is saved to your table.
I've been hoping MS would correct what I consider a little flaw. Using
a bound form, one can have a BeforeUpdate event that will cancel the
save process. However, if one presses the X close button it will pop up
my validation message, cancel the event, but continue on to the Unload
process. It would be great if the B4Update event would truely cancel
the event and stop execution of the close window caused by pressing the
X close.
It's not too bad if one has been editting an existing record. But for a
new record all data is lost by the time it gets to the Unload event.
The OPs problem is with unbound forms and my comment is related to bound
forms.