Djblois
01-24-2007, 03:16 PM
I am using this code to add Controls to My User Form "PivotTableOptions"
LC = "ItemCode"
NO = "NoItemNumber"
SBI = "SortbyItem"
SBP = "SortbyProduct"
PivotTableOptions.Controls.Add bstrProgId:="Forms.Frame.1", Name:=LC, Visible:=True
PivotTableOptions.Controls(LC).Top = 168
PivotTableOptions.Controls(LC).Left = 2
PivotTableOptions.Controls(LC).Height = 70
PivotTableOptions.Controls(LC).Width = 210
PivotTableOptions.Controls(LC).Caption = "Do you want Item# in the Report?"
PivotTableOptions.Controls(LC).Font.Bold = True
PivotTableOptions.Controls(LC).Add bstrProgId:="Forms.optionbutton.1", Name:=SBP, Visible:=True
PivotTableOptions.Controls(SBP).Top = 14
PivotTableOptions.Controls(SBP).Left = 12
PivotTableOptions.Controls(SBP).Height = 14
PivotTableOptions.Controls(SBP).Width = 120
PivotTableOptions.Controls(SBP).Caption = "Yes, Sort by Product"
PivotTableOptions.Controls(SBP).Font.Bold = True
PivotTableOptions.Controls(SBP).GroupName = Itemcode
PivotTableOptions.Controls(LC).Add bstrProgId:="Forms.optionbutton.1", Name:=SBI, Visible:=True
PivotTableOptions.Controls(SBI).Top = 38
PivotTableOptions.Controls(SBI).Left = 12
PivotTableOptions.Controls(SBI).Height = 14
PivotTableOptions.Controls(SBI).Width = 120
PivotTableOptions.Controls(SBI).Caption = "Yes, Sort by Item#"
PivotTableOptions.Controls(SBI).Font.Bold = True
PivotTableOptions.Controls(SBI).GroupName = Itemcode
PivotTableOptions.Controls(LC).Add bstrProgId:="Forms.optionbutton.1", Name:=NO, Visible:=True
PivotTableOptions.Controls(NO).Top = 27
PivotTableOptions.Controls(NO).Left = 140
PivotTableOptions.Controls(NO).Height = 14
PivotTableOptions.Controls(NO).Width = 30
PivotTableOptions.Controls(NO).Caption = "No"
PivotTableOptions.Controls(NO).Font.Bold = True
PivotTableOptions.Controls(NO).Value = True
PivotTableOptions.Controls(NO).GroupName = Itemcode
However, Now I ran out of room on that form, so I added Pages to it. Now I want to use that code to add it to the page named "ReportSetup". I can't get it to work I thought I would put
PivotTableOptions.ReportSetup.Controls
etc.. But that didn't work
LC = "ItemCode"
NO = "NoItemNumber"
SBI = "SortbyItem"
SBP = "SortbyProduct"
PivotTableOptions.Controls.Add bstrProgId:="Forms.Frame.1", Name:=LC, Visible:=True
PivotTableOptions.Controls(LC).Top = 168
PivotTableOptions.Controls(LC).Left = 2
PivotTableOptions.Controls(LC).Height = 70
PivotTableOptions.Controls(LC).Width = 210
PivotTableOptions.Controls(LC).Caption = "Do you want Item# in the Report?"
PivotTableOptions.Controls(LC).Font.Bold = True
PivotTableOptions.Controls(LC).Add bstrProgId:="Forms.optionbutton.1", Name:=SBP, Visible:=True
PivotTableOptions.Controls(SBP).Top = 14
PivotTableOptions.Controls(SBP).Left = 12
PivotTableOptions.Controls(SBP).Height = 14
PivotTableOptions.Controls(SBP).Width = 120
PivotTableOptions.Controls(SBP).Caption = "Yes, Sort by Product"
PivotTableOptions.Controls(SBP).Font.Bold = True
PivotTableOptions.Controls(SBP).GroupName = Itemcode
PivotTableOptions.Controls(LC).Add bstrProgId:="Forms.optionbutton.1", Name:=SBI, Visible:=True
PivotTableOptions.Controls(SBI).Top = 38
PivotTableOptions.Controls(SBI).Left = 12
PivotTableOptions.Controls(SBI).Height = 14
PivotTableOptions.Controls(SBI).Width = 120
PivotTableOptions.Controls(SBI).Caption = "Yes, Sort by Item#"
PivotTableOptions.Controls(SBI).Font.Bold = True
PivotTableOptions.Controls(SBI).GroupName = Itemcode
PivotTableOptions.Controls(LC).Add bstrProgId:="Forms.optionbutton.1", Name:=NO, Visible:=True
PivotTableOptions.Controls(NO).Top = 27
PivotTableOptions.Controls(NO).Left = 140
PivotTableOptions.Controls(NO).Height = 14
PivotTableOptions.Controls(NO).Width = 30
PivotTableOptions.Controls(NO).Caption = "No"
PivotTableOptions.Controls(NO).Font.Bold = True
PivotTableOptions.Controls(NO).Value = True
PivotTableOptions.Controls(NO).GroupName = Itemcode
However, Now I ran out of room on that form, so I added Pages to it. Now I want to use that code to add it to the page named "ReportSetup". I can't get it to work I thought I would put
PivotTableOptions.ReportSetup.Controls
etc.. But that didn't work