The simplest way is to use the Form_QueryUnload Event, check the value of UnloadMode and set the cancel variable true.
something like
Code:
Private Sub Form_QueryUnload(cancel As Integer, unloadmode As Integer)
select case unloadmode
case vbFormControlMenu
'Do your task here
Cancel = 1 'cancel form close
case else
cancel = 0
end select
end sub
but I can't see why you would want to do this!
Take Care
Matt
If at first you don't succeed, skydiving is not for you.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.