Warning Message Needed for User Who "X" Out of Certain Form

drmingle

Board Regular
Joined
Oct 5, 2009
Messages
229
I am attempting to have a pop message display when users of a certain form "X" out of the form. Below is what I came up with but it does not seem to be working:

Code:
Private Sub IntroUpdate_BeforeClose(Cancel As Boolean)
Call MsgBox("User closed the program before any formulas were updated.", vbExclamation, ".: ALERT: FM Program Tabs :.")
End Sub

Currently the above is in the code section of the form (titled: IntroUpdate).

Also if the form unloads I do not want the message displayed - only in the event that a user "X" out of the specific form titled: IntroUpdate).

Thanks as always for your help
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try this...

Code:
[color=darkblue]Private[/color] [color=darkblue]Sub[/color] UserForm_QueryClose(Cancel [color=darkblue]As[/color] [color=darkblue]Integer[/color], CloseMode [color=darkblue]As[/color] [color=darkblue]Integer[/color])
    [color=darkblue]If[/color] CloseMode = 0 [color=darkblue]Then[/color]
        MsgBox "User closed the program before any formulas were updated.", _
               vbExclamation, ".: ALERT: FM Program Tabs :."
    [color=darkblue]End[/color] [color=darkblue]If[/color]
End [color=darkblue]Sub[/color]

Don't change the name of the procedure. It's required to be called UserForm_QueryClose
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top