Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MsgBox if main form is closed and sub form is still open

Status
Not open for further replies.

LarryDavidow

Technical User
Apr 22, 2002
56
US
I have a sub form that is dependant on data in the main form. I want a message box to pop up if the user tries closing the main form before the sub form is closed.

Any help... much appreciated! [thumbsup2]

 
I was under the impression that a subform was part of the main form, ie, one unit. Out of curiousity, how can you close the main from without closing the sub form at the same time??????

Maybe I totally misunderstand what you are looking for, it wouldn't be the first time.

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
You can create a sub form and have it as an independant form without having it imbedded in the main form, but have the same advantages of a subform
 
I appreciate your explnation. I never needed to do this and at the moment can't think of a reason.

Anyway, try using the On Exit event of the main form. You could use vbyes/no and undo which can ask a question and not allow the closing and a criteria stating that the sub form is closed. I think this concept would work.

Again, thanks for the info. I will have to try.

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top