Well, if the record HAS NOT been edited, then the before update
event WILL NOT fire.
If the record has been modified, then the before update event
will fire.
The above occurs if you close the form with the X. or any other
means.
So, if are you trying to trap the fact that the record has been
edited, that code can simply be put in the before update event.
The fact that you used the "x" to close the form DOES NOT change
this fact.
If the form has not been edited...then the before update code
does not run.
So, if the form is closing, and you modified the data...then
before update runs. If the form is closing, and you did not
modify the data...then before update does NOT run.
You can certainly have some code in the forms close event.
However, why does it make a difference if the record is being
updated due to record movement, or the form being closed? (in
both cases...you want to update the record...right?).
You can always set a global flag in the forms on-current event.
Then, in the before update event, you can go:
dataMod = true
Then, in the close event of the form, you can go:
if dataMod = True then
msgbox "form closed, and data was saved/modified"
else
msgbox "form closed...data was not changed"
end if
Still at a loss as to why you need the above...but it will
work...
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.attcanada.net/~kallal.msn