Andy Lacey
andy at minstersystems.co.uk
Tue Apr 29 01:36:24 CDT 2003
Alternatively check what form is open, dim frm as form, set frm to that open form then do all of the updates under a With frm statement. To check what form is open call this for each of the possibles. Function IsScreenOpen(strName As String) As Boolean IsScreenOpen = (SysCmd(acSysCmdGetObjectState, acForm, strName) = acObjStateOpen) End Function Andy Lacey http://www.minstersystems.co.uk > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of > Stuart McLachlan > Sent: 29 April 2003 06:49 > To: John Bartow; accessd at databaseadvisors.com > Subject: Re: [AccessD] Retrofit form issue > > > On 28 Apr 2003 at 23:59, John Bartow wrote: > > > Right now the popup form is duplicated 4 times, each one is > only used > > by one main form and each main form only calls one of the > popups. The > > calling form is hardcoded in each specific popup form's > code and that > > is how the return values are put into the main form that called it. > > > > This form is going to get reused again and again and I > would like to > > eliminate that maintenance overhead. I am burnt out at the > moment and > > would like some advice on how to handle changing these main > forms to > > call one popup form but still be able to update the 7 items on the > > main form that called it. > > > Pass the name of the calling form in OpenArgs when you open > the popup and use that to set the values. Here's the bare > bones which just updates one text box > > > In your main form's popup calling event: > Private Sub cmdOpenPopup_Click() > DoCmd.OpenForm "frmPopup", , , , , , Me.Name > End Sub > ........ > > In your Popup form: > > Private strCallingForm As String > > Private Sub Form_Open(Cancel As Integer) > strCallingForm = OpenArgs > End Sub > > Private Sub CmdUpdateCallingForm_Click() > Forms(strCallingForm).txtMyInfo = "Updated" DoCmd.Close End Sub > > > -- > Stuart McLachlan > Lexacorp Ltd > Application Development, IT Consultancy http://www.lexacorp.com.pg > > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/a> ccessd > Website: > http://www.databaseadvisors.com >