SubFormControlName

  • Thread starter Thread starter Larry
  • Start date Start date
L

Larry

I'm new to Access. Could someone please explain exactly what a SubFormControlName is. I know that it's not always the same as the form name. Thanks
 
Hi Larry,

Subforms are fantastic, and they are one of the features that sets
Access apart from many other database development tools. But when you
are talking about them, sometimes the terminology can be a bit
confusing. So let's start with this... A form can have controls placed
upon it. Textbox, combobox, label, image, etc. These controls have a
name, and this is defined in the setting of the Name property of the
control. And also, the form itself has a name. One of the types of
control that can be on a form is a subform control. Some people call it
a subform container. This, as you know, is a control that can display
another form. Now, the form which is displayed in the subform control
has a name. And the subform control that this other form is shown in
also has a name. The name of the subform control can be the same as the
name of the form it contains, or it can be different. But often, in
expressions or code, it is necessary to refer to the name of the subform
control. If the name of the subform control is different from the name
of the form it contains, it is the name of the subform control that is
applicable, and not the name of the form it contains. So, you will
sometimes see reference in sample code etc to SubFormControlName, and
this is simply a way of emphasising that it is the name of the subform
control that should be used.
 
We Access book or people refer to the "Subform", they actually talk about 2
different entities as one (and hence it is rather confusing). The 2
entities are:

1. The SubformControl: I like to think of the as the rectangular space on
the Main Form that is reserved for the second entity. Think of this as the
container for another Form. The 3 important Properties of the
SubformControl are LinkMasterFields, LinkChildFields and the SourceObject
Property.

2. The SourceObject is another Form that is used as the "Subform" (in
general sense), i.e. contained in the SubformControl. You specify the
SourceObject by assigning the name of this Form in the SourceObject Property
of the SubformControl.

Thus, when you refer to the "Subform" or a Control on the "Subform", you
need to use the hierachical reference like:

Forms!MainFormName!SubformControlName.Form!ControlName

since the Form being used as the SourceObject is not a member of the Forms
Collection.

--
HTH
Van T. Dinh
MVP (Access)




Larry said:
I'm new to Access. Could someone please explain exactly what a
SubFormControlName is. I know that it's not always the same as the form
name. Thanks
 
Back
Top