Mark A Matte
markamatte at hotmail.com
Fri Jan 5 09:22:45 CST 2007
Thank you very much for the suggestion. Unfortunately I needed the 'BeforeUpdate' on the subform to fire correctly before the form closed. So I disabled the 'x' at the top and created an exit button on the main form with the following: Me.sfrmView.Form.Form_Current sfrmView.SourceObject = "frmBlank" DoCmd.Close This calls the Form_Current of the subform...which fires the subform 'Before-UPdate'...and then frm blank is just a blank form to break the connection between the 2 forms. I tried sfrmView.SourceObject = "" ...but was told(error) cannot not set property to zero length in FormView. This is why the frmBlank. Not sure if this is the best approach...but my code fires in the sequence I need. Any other suggestions are always welcome. Thanks, Mark A. Matte >From: "A.D.TEJPAL" <adtp at airtelbroadband.in> >Reply-To: Access Developers discussion and problem >solving<accessd at databaseadvisors.com> >To: "Access Developers discussion and problem >solving"<accessd at databaseadvisors.com> >Subject: Re: [AccessD] Closing Subform >Date: Fri, 5 Jan 2007 10:59:20 +0530 > >Mark, > > Unload event of main form takes place BEFORE that of the subform. >(Interestingly, load event of main form takes place AFTER that of the >subform). As a result execution of any code in subform at this stage, that >refers to the main form, would attract error. > > As a remedial action, you can put the following statement at the >beginning of relevant code block in the subform: > > On Error Resume Next > >Best wishes, >A.D.Tejpal >--------------- > > ----- Original Message ----- > From: Mark A Matte > To: accessd at databaseadvisors.com > Sent: Friday, January 05, 2007 01:32 > Subject: [AccessD] Closing Subform > > > Hello All, > > In A97 I have a form with a subform...the subform has a 'Before_Update' >event. When I close the main form I get an error that the >'Before_Update'(on subform) event is trying to do stuff and can't find the >main form. > > How should I close the main form? > > Thanks, > > Mark A. Matte >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com _________________________________________________________________ >From photos to predictions, The MSN Entertainment Guide to Golden Globes has it all. http://tv.msn.com/tv/globes2007/?icid=nctagline1