[AccessD] Unbound subform

Nicholson, Karen cyx5 at cdc.gov
Wed Sep 15 11:24:34 CDT 2004


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



More information about the AccessD mailing list