I need help with code to close two forms at the same time, FormA and FormB. I
need code that can be used from either form and needs to work with both a
'Close' button on each form as well as if the user clicks the 'X' in the
control box.
I have a function, IsObjectOpen, that can be used to check if a form is open.
The function is used as follows:
X = IsObjectOpen(FormName,2)
where 2 is for forms.
I've tried to code this but I keep getting errors that an object is closed
already when I try closing it. It seems like what is happening that code
within FormA or FormB close event is trying to close the other form. But when
that code executes it too tries to close the other form so a conflict occurs.
I thought the IsObjectOpen form would take care of this, but it appears to be
claiming a form is open when it is in the act of being closed, so the close
event tries to execute once.
IMPORTANT: The code needs to be able to work from either a close button on
either form or when the user clicks on the 'X' in the control box in either
form. I haven't been able to get this to work correctly for all 4 possible
ways of closing both forms.
Help on how to code this is greatly appreciated.
Thank you.
--
Message posted via http://www.accessmonster.com