> The Form in a Subform Control, even when displayed, is not "Open" -- it is
accessible as the Form property of the Control but does not exhibit the
attributes of an Open Form.
10-4
I think you will need some logic to determine the Form that is embedded as
the Source Object in the Subform Control, and open in separately, in
Design View.
see below...
Yes, a Subform Control does have Properties that apply to the Subform
Control in addition to the Form embedded in the Subform Control having its
own Properties.
10-4
Continuing with the example of trying to set the SubForm property
"SpecialEffect" on a SubForm Control - I don't believe opening the SubForm
in design mode will help since there is no SpecialEffect property for the
form itself, but only on the SubForm control.
So, I looped through each of the 5 properties like this:
For Each ctl In frm.Controls
If ctl.ControlType = 112 Then
With ctl
For Each prp In ctl.Properties
Debug.Print prp.Inherited & " (Inherited)"
Debug.Print prp.Name & " (Name)"
'Debug.Print prp.Properties & "(Properties)"
For Each varItem In prp.Properties
Debug.Print varItem & " (prp.Properties_Item)"
Next
Debug.Print prp.Type & "(Type)"
Debug.Print prp.Value & "(Value)"
Next
End With
See results below...
The problem now is identifying which property to change: the first property
returned [1] has the name of the SubForm for prp.Value, and then about the
20th [2] has SpecialEffect property, with the corresponding prp.Value [3]
that I'm after.
In the rst, there may be several ctl.ControlType = 112 (SubForms).
Therefore, I need to identify which SubForm I'm working with - prior to the
control structure "For Each prp In ctl.Properties..." - that way I can
change the right prp.Value for the right SubForm. Is there a way to
identify the control with a Control property?
There does not appear to be a "Ctl.Name", but there is:
Ctl.ItemData
Ctl.Object
Ctl.Parent
etc...
but I'm not sure how to work with these, or if they can help me identlfy
the name of the SubForm.
Alternatively, if I can rely on the order in which the properties are
returned, I could use something like this:
With ctl
For Each prp In ctl.Properties
If prp.Value = rst!ObjectName Then
Find Next prp.Name In ctl.Properties <<==== ??? pseudo code
Where prp.Name = rst!PropName <<=== ???
prp.Value = rst!NewValue
End If
Next
End If
Next
End With
Any suggestions on how to identify the Subform in question?
Thanks again for your help - I appreciate your patience with this one...
EventProcPrefix (Name)
(prp.Properties_Item)
8(Type)
frmPropertiesDataSheet(Value) <<=== * [1]
Name (Name)
(prp.Properties_Item)
8(Type)
frmPropertiesDataSheet(Value)
ControlType (Name)
(prp.Properties_Item)
2(Type)
112(Value)
SourceObject (Name)
(prp.Properties_Item)
8(Type)
frmPropertiesDataSheet(Value)
LinkChildFields (Name)
(prp.Properties_Item)
8(Type)
(Value)
LinkMasterFields (Name)
(prp.Properties_Item)
8(Type)
(Value)
StatusBarText (Name)
(prp.Properties_Item)
8(Type)
(Value)
Visible (Name)
(prp.Properties_Item)
11(Type)
True(Value)
DisplayWhen (Name)
(prp.Properties_Item)
2(Type)
0(Value)
Enabled (Name)
(prp.Properties_Item)
11(Type)
True(Value)
Locked (Name)
(prp.Properties_Item)
11(Type)
False(Value)
TabStop (Name)
(prp.Properties_Item)
11(Type)
True(Value)
TabIndex (Name)
(prp.Properties_Item)
2(Type)
0(Value)
CanGrow (Name)
(prp.Properties_Item)
11(Type)
True(Value)
CanShrink (Name)
(prp.Properties_Item)
11(Type)
False(Value)
Left (Name)
(prp.Properties_Item)
2(Type)
1514(Value)
Top (Name)
(prp.Properties_Item)
2(Type)
764(Value)
Width (Name)
(prp.Properties_Item)
2(Type)
12240(Value)
Height (Name)
(prp.Properties_Item)
2(Type)
6645(Value)
SpecialEffect (Name) <<==== * [2]
(prp.Properties_Item)
2(Type)
2(Value) <<=========== * [3]
BorderStyle (Name)
(prp.Properties_Item)
2(Type)
1(Value)
OldBorderStyle (Name)
(prp.Properties_Item)
2(Type)
1(Value)
BorderWidth (Name)
(prp.Properties_Item)
2(Type)
0(Value)
BorderLineStyle (Name)
(prp.Properties_Item)
2(Type)
0(Value)
BorderColor (Name)
(prp.Properties_Item)
3(Type)
0(Value)
Section (Name)
(prp.Properties_Item)
2(Type)
0(Value)
Tag (Name)
(prp.Properties_Item)
8(Type)
(Value)
InSelection (Name)
(prp.Properties_Item)
11(Type)
False(Value)
OnEnter (Name)
(prp.Properties_Item)
8(Type)
(Value)
OnExit (Name)
(prp.Properties_Item)
8(Type)
(Value)