If Then for on Form Close

  • Thread starter Thread starter Angelsnecropolis
  • Start date Start date
A

Angelsnecropolis

I have a form that displays a MSGBox beforeupdate when specific fields are
null. If these fields haven't been touched then the form closes like normal.
After the fields have been maintain

I'd like to be able to add an If...then statement so on form close don't
display msgbox.
 
Form_Close occurs *after* Form_BeforeUpdate, so you can't avoid the message
like that.

Perhaps you could add a button to cancel'n'close:
If Me.Dirty Then Me.Undo
DoCmd.Close acForm, Me.Name

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
Thank you Mr. Browne.

Allen Browne said:
Form_Close occurs *after* Form_BeforeUpdate, so you can't avoid the message
like that.

Perhaps you could add a button to cancel'n'close:
If Me.Dirty Then Me.Undo
DoCmd.Close acForm, Me.Name

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
 
Back
Top