hazlehurstga
Programmer
I'm running into problems when I try to create an OptionGroup with more than one label. The general text of my code is as follows:
'First I create a new OptionGroup control:
Set ctlText = CreateControl(CurForm.Name, acOptionGroup, acDetail, "", "", 1440, 1440)
'Then I add the first label and option button, bounding them to the ctlText OptionGroup previously created:
Set ctlLabel = CreateControl(CurForm.Name, acLabel, , ctlText.Name, "", (1440*7.2847), (1440*0.875)))
Set ctlButton = CreateControl(CurForm.Name, acOptionButton, , ctlText.Name, "", (1440*7.2800), (1440*0.875)))
'I run into problems when I attempt to add and bound a second label to the same ctlText OptionGroup:
Set ctlLabel = CreateControl(CurForm.Name, acLabel, acDetail, ctlText.Name, "", (1440*7.2847), (1440*1.1042))
I get the following error message when the compiler attempts to excute the previous line above:
"The parent control can't contain the type of control you selected."
Can someone please tell me where I went wrong.
Thank you!!
'First I create a new OptionGroup control:
Set ctlText = CreateControl(CurForm.Name, acOptionGroup, acDetail, "", "", 1440, 1440)
'Then I add the first label and option button, bounding them to the ctlText OptionGroup previously created:
Set ctlLabel = CreateControl(CurForm.Name, acLabel, , ctlText.Name, "", (1440*7.2847), (1440*0.875)))
Set ctlButton = CreateControl(CurForm.Name, acOptionButton, , ctlText.Name, "", (1440*7.2800), (1440*0.875)))
'I run into problems when I attempt to add and bound a second label to the same ctlText OptionGroup:
Set ctlLabel = CreateControl(CurForm.Name, acLabel, acDetail, ctlText.Name, "", (1440*7.2847), (1440*1.1042))
I get the following error message when the compiler attempts to excute the previous line above:
"The parent control can't contain the type of control you selected."
Can someone please tell me where I went wrong.
Thank you!!