For a = 0 To Me!FieldList.ListCount - 1
If Me!FieldList.Selected(a) = True Then
Fieldname1 = Me!FieldList.ItemData(a)
' Create unbound default-size text box in detail section.
Set ctlText = CreateControl(frmMain.Name, acTextBox, , , "", intDataX, intDataY)
' Create child label control for text box.
Set ctlLabel = CreateControl(frmMain.Name, acLabel, , ctlText.Name, Fieldname1, intLabelX, intLabelY)
intLabelY = intLabelY + 300
intDataY = intDataY + 300
End If
Next
DoCmd.Restore
DoCmd.Save acForm, "Form2"
'insert sub form
' subforms Object source in Main form
Dim SourceObjectName As String
SourceObjectName = FormName & " Subform"
Set ctlLabel = CreateControl(frmMain.Name, acSubform, acDetail, frmSub.Name, SourceObjectName, 3500, 100, 6000, 2000)
I manged to add a subform object to a main form but cannot find the property to make the subforms Source Object set to a subform I just created in th etop portion of the code.
Any Ideas
DougP, MCP
If Me!FieldList.Selected(a) = True Then
Fieldname1 = Me!FieldList.ItemData(a)
' Create unbound default-size text box in detail section.
Set ctlText = CreateControl(frmMain.Name, acTextBox, , , "", intDataX, intDataY)
' Create child label control for text box.
Set ctlLabel = CreateControl(frmMain.Name, acLabel, , ctlText.Name, Fieldname1, intLabelX, intLabelY)
intLabelY = intLabelY + 300
intDataY = intDataY + 300
End If
Next
DoCmd.Restore
DoCmd.Save acForm, "Form2"
'insert sub form
' subforms Object source in Main form
Dim SourceObjectName As String
SourceObjectName = FormName & " Subform"
Set ctlLabel = CreateControl(frmMain.Name, acSubform, acDetail, frmSub.Name, SourceObjectName, 3500, 100, 6000, 2000)
I manged to add a subform object to a main form but cannot find the property to make the subforms Source Object set to a subform I just created in th etop portion of the code.
Any Ideas
DougP, MCP