Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: If Then for on Form Close

Geek News

If Then for on Form Close
Angelsnecropolis 12/7/2008 12:57:00 AM
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.


Re: If Then for on Form Close
"Allen Browne" <AllenBrowne[ at ]SeeSig.Invalid> 12/7/2008 3:41:55 AM
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
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Angelsnecropolis" <Angelsnecropolis[ at ]discussions.microsoft.com> wrote in
message
news:417BB139-878C-4462-A6CD-833358CD2BFF[ at ]microsoft.com...
[Quoted Text]
>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.

Re: If Then for on Form Close
Angelsnecropolis 12/8/2008 1:46:05 AM
Thank you Mr. Browne.

"Allen Browne" wrote:

[Quoted Text]
> 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
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Angelsnecropolis" <Angelsnecropolis[ at ]discussions.microsoft.com> wrote in
> message
> news:417BB139-878C-4462-A6CD-833358CD2BFF[ at ]microsoft.com...
> >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.
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net