In an application : - Form1 invokes Form2 through FrmPopupForm(idForm2). - Form2 invokes in turn Form3 through FrmPopupForm(idForm3). - Form3 calls FrmReturnToForm(0) and sets a flag in globals to tell Form2 to return as well. - in frmUpdateEvent processing of Form2, the flag is tested and when true, Form2 calls FrmReturnToForm(0).
Here, an error message pops up, saying that I try reading an unallocated chunk of memory: it seems that this recursive scheme does not work. Looking closer at the problem, here is my understanding: FrmReturnToForm(0) from Form3 to Form2 sends*immediately* a frmUpdateEvent to Form2. The processing of this event consists in a FrmReturnToForm(0) from Form2 to Form1. However, this 2nd FrmReturnToForm erases Form2 while Form3 isn't fully terminated: the last part of Form3 termination acts on a no-longer allocated Form2, thus the error message. Questions: - Is it safe to ignore the error message, since it seems to work anyway (after all it's simply a question of "form destructors" execution order)? - Is there a better way to have the same behavior, that is: having 2 FrmReturnToForm(0) chained? For instance, I could catch another event than frmUpdateEvent, allthough I don't see which one... -- Denis Faivre - [EMAIL PROTECTED] -- Ablivio - http://www.ablivio.com -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
