I'm getting a "Object does not support this method or property" at the line
for setting the .Parent property below when I try this.
----------------------------------------------------
Dim ctl as Control
Dim opt as OptionButton
' optGroup
Set ctl = CreateControl(frm.Name, acOptionGroup, acDetail, , , 8640, 300,
6180, 6060)
With ctl
.Name = "optGroup"
.Visible = True
.DisplayWhen = 0
.Enabled = True
.Locked = False
.TabStop = True
.TabIndex = 0
.BackStyle = 0
.BackColor = 16777215
.SpecialEffect = 3
.BorderStyle = 1
.OldBorderStyle = 1
.BorderColor = 0
.BorderWidth = 0
.BorderLineStyle = 0
.HelpContextId = 0
.ColumnWidth = -1
.ColumnOrder = 0
.ColumnHidden = False
End With
' begin loop through recordset
' opt
Set opt = CreateControl(frm.Name, acOptionButton, acDetail, , , 9480,
intTopOpt, 260, 240)
With opt
.Name = "opt" & iOpt
.Visible = True
.DisplayWhen = 0
.parent =frm.optGroup
.OptionValue = CInt(rstOptions.Fields("code"))
.Enabled = True
.Locked = False
.SpecialEffect = 2
.BorderStyle = 1
.OldBorderStyle = 1
.BorderWidth = 0
.BorderLineStyle = 0
.BorderColor = 0
.HelpContextId = 0
.ReadingOrder = 0
End With
' lblOpt
Set ctl = CreateControl(frm.Name, acLabel, acDetail, , , 9710, intTop, 4695,
330)
With ctl
.Name = "lblOpt" & iOpt
.Caption = rstOptions.Fields("OptionText")
.Visible = True
.DisplayWhen = 0
.Vertical = False
.BackStyle = 0
.BackColor = 16777215
.SpecialEffect = 0
.BorderStyle = 0
.OldBorderStyle = 0
.BorderColor = 0
.BorderWidth = 0
.BorderLineStyle = 0
.ForeColor = 0
.FontName = "Tahoma"
.FontSize = 12
.FontWeight = 400
.FontItalic = False
.FontUnderline = False
.TextFontCharSet = 0
.TextAlign = 0
.FontBold = 0
.ReadingOrder = 0
.NumeralShapes = 0
.LeftMargin = 0
.TopMargin = 0
.RightMargin = 0
.BottomMargin = 0
.LineSpacing = 0
End With
' end loop throught recordset