D
dbp428
Making a subforms Source Object see an existing form using
VBA.
I wrote code to create a main form and a subform
I managed to add a subform to the main form. But I cannot
make the subform see the newly created subform. There
appears to be no property available to do this using VBA.
Here is my code:
'insert sub form into main form
Dim SourceObjectName As String
SourceObjectName = FormName & " Subform"
Set ctlSubform = CreateControl(frmMain.Name,
acSubform, acDetail, frmSub.Name, SourceObjectName, 3500,
100, 6000, 2000)
'ctlSubform.Name = frmSub.Name
Set ctlButton = CreateControl(frmMain.Name,
acCommandButton, acDetail, "", "", 1000, 1200, 1200, 400)
ctlButton.Caption = "Find..."
-------------------
VBA.
I wrote code to create a main form and a subform
I managed to add a subform to the main form. But I cannot
make the subform see the newly created subform. There
appears to be no property available to do this using VBA.
Here is my code:
'insert sub form into main form
Dim SourceObjectName As String
SourceObjectName = FormName & " Subform"
Set ctlSubform = CreateControl(frmMain.Name,
acSubform, acDetail, frmSub.Name, SourceObjectName, 3500,
100, 6000, 2000)
'ctlSubform.Name = frmSub.Name
Set ctlButton = CreateControl(frmMain.Name,
acCommandButton, acDetail, "", "", 1000, 1200, 1200, 400)
ctlButton.Caption = "Find..."
-------------------