Francisco Tapia
fhtapia at gmail.com
Wed Sep 15 12:55:35 CDT 2004
you can also set the sourceobject = "" and when the control is clicked, you can set the sourceobject = "frm_yoursubformName" On Wed, 15 Sep 2004 12:24:34 -0400, Nicholson, Karen <cyx5 at cdc.gov> wrote: > When the main form opens, set the subform.visible=false > When the button is clicked on the main form, then fire the > subform.visible=true > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Nancy Lytle > Sent: Wednesday, September 15, 2004 12:03 PM > To: AccessD at databaseadvisors.com > Subject: [AccessD] Unbound subform > > I have a form that contains a subform. I would like > this subform to be unbound and not visible until a > button is clicked on the main form. I cannot get the > subform bound properly. I get the "The expression you > entered refers to an object that is closed or doesn't > exist" error. > I had it at one time and lost it. > Any ideas? > TIA > Nancy > > The name of the subform control is sbffrmReceiving > The name of the subform is frmReceiving > I put the name of the subform control it the control's > tag property. > > This is the code I am using: > Private sub cmdOpenRec_Click(): > > Me.sbffrmReceiving.Visible = True > Me.sbffrmReceiving.SetFocus > > If Len(Me.sbffrmReceiving.Form.SourceObject) = 0 Then > > Me.sbffrmReceiving.Form.SourceObject = > Me.sbffrmReceiving.Form.Tag > > Me.sbffrmReceiving.Form.LinkChildFields = > Forms!Me.sbffrmReceiving.Form.LinkChildFields > > Me.sbffrmReceiving.Form.LinkMasterFields = > Me.sbffrmReceiving.Form.LinkMasterFields > End If > > -- > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- -Francisco "Rediscover the web" http://www.mozilla.org/products/firefox/ ttp://spreadfirefox.com/community/?q=affiliates&id=792&t=86