Djblois
01-03-2007, 04:44 PM
I am using this code to add controls to a form. I have the first part working-adding a frame to the form but I can't seem to add the optionbuttons to the form I just added then
Dim LC, No, SBC, SBP As String
LC = "ItemCode"
No = "No"
SBC = "SortbyItem"
SBP = "SortbyProduct"
PivotTableOptions.Controls.Add bstrProgId:="Forms.Frame.1", Name:=LC, Visible:=True
PivotTableOptions.Controls(LC).Top = 157
PivotTableOptions.Controls(LC).Left = 6
PivotTableOptions.Controls(LC).Height = 70
PivotTableOptions.Controls(LC).Width = 210
PivotTableOptions.Controls(LC).Caption = "Do you want Item code in the Report?"
PivotTableOptions.Itemcode.Controls.Add bstrProgId:="Forms.optionbutton.1", Name:=No, Visible:=True
PivotTableOptions.Itemcode.Controls(LC).Top = 10
PivotTableOptions.Itemcode.Controls.Left = 6
PivotTableOptions.Itemcode.Controls.Height = 10
PivotTableOptions.Itemcode.Controls(LC).Width = 10
PivotTableOptions.Itemcode.Controls(LC).Caption = "No"
Dim LC, No, SBC, SBP As String
LC = "ItemCode"
No = "No"
SBC = "SortbyItem"
SBP = "SortbyProduct"
PivotTableOptions.Controls.Add bstrProgId:="Forms.Frame.1", Name:=LC, Visible:=True
PivotTableOptions.Controls(LC).Top = 157
PivotTableOptions.Controls(LC).Left = 6
PivotTableOptions.Controls(LC).Height = 70
PivotTableOptions.Controls(LC).Width = 210
PivotTableOptions.Controls(LC).Caption = "Do you want Item code in the Report?"
PivotTableOptions.Itemcode.Controls.Add bstrProgId:="Forms.optionbutton.1", Name:=No, Visible:=True
PivotTableOptions.Itemcode.Controls(LC).Top = 10
PivotTableOptions.Itemcode.Controls.Left = 6
PivotTableOptions.Itemcode.Controls.Height = 10
PivotTableOptions.Itemcode.Controls(LC).Width = 10
PivotTableOptions.Itemcode.Controls(LC).Caption = "No"