cancel unload event on mainform from subform unload event???

K

KLZA

hi people. first thanks to all those helping us novices how to code
correctly. thanks a bunch!
here's my dilemma... i have a main form "Accounts" that "quits"
access on unload via macro. i have subform "Accountssubformm" that
i'd like to code its "unload" or "close" event to "close" the main
form without triggering the main form's unload event. I'd like a
real
close on the main form, not minimize or hide etc. I'd also like to
immediately re-open the "Accounts" main form as if being opened from
the main database window. Can this be done? Here's how the subforms
unload event looks so far...

Private Sub Form_Unload(Cancel As Integer)
DoCmd.Close acForm, "Accounts", acSaveYes
If Me.Unload Then Me.Unload = False '<<<------------- THIS IS
WHERE I"M HAVING TROUBLE...
DoCmd.OpenForm "Accounts"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top