Im trying to set control sources of grid columns to the active page in a page frame. I know I can put the individual code for each page into a case statement but I was looking for something a little more dynamic. Here's what I tried that obviously doesnt work but shows what Im trying to achieve. Thanks for any input.
lcRecSource = this.RecordSource && RecordSource is a property of my pageframe
DO CASE
CASE this.activepage = 1
lcRectype = "_StandardCargo"
CASE this.activepage = 2
lcRectype = "_Rentals"
CASE this.activepage = 3
lcRectype = "_Tubular"
CASE this.activepage = 4
lcRectype = "_wellheads"
CASE this.activepage = 5
lcRectype = "_bits"
CASE this.activepage = 6
lcRectype = "_mud"
ENDCASE
This.activepage.recnew_grid11.recordsource = lcRecSource+lcRectype
This.activepage.recnew_grid11.Column1.ControlSource = lcRecSource+lcRectype+".hm"
This.activepage.recnew_grid11.Column2.ControlSource = lcRecSource+lcRectype+".cntr"
This.activepage.recnew_grid11.Column3.ControlSource = lcRecSource+lcRectype+".rcdate"
This.activepage.recnew_grid11.Column4.ControlSource = lcRecSource+lcRectype+".size"
This.activepage.recnew_grid11.Column5.ControlSource = lcRecSource+lcRectype+".weight"
This.activepage.recnew_grid11.Column6.ControlSource = lcRecSource+lcRectype+".ser"
This.activepage.recnew_grid11.Column7.ControlSource = lcRecSource+lcRectype+".desc"
This.activepage.recnew_grid11.Column8.ControlSource = lcRecSource+lcRectype+".qty"
This.activepage.recnew_grid11.Column9.ControlSource = lcRecSource+lcRectype+".unit"
This.activepage.recnew_grid11.Column10.ControlSource = lcRecSource+lcRectype+".vendor"
This.activepage.recnew_grid11.Column10.autofill_ven_grid1.ControlSource = lcRecSource+lcRectype+".vendor"
This.activepage.recnew_grid11.Column11.ControlSource = lcRecSource+lcRectype+".vdata"
This.activepage.recnew_grid11.Column12.ControlSource = lcRecSource+lcRectype+".vticket"
selRec = lcRecsource+lcRectype
SELECT &selRec
GO TOP
thisform.Refresh()
lcRecSource = this.RecordSource && RecordSource is a property of my pageframe
DO CASE
CASE this.activepage = 1
lcRectype = "_StandardCargo"
CASE this.activepage = 2
lcRectype = "_Rentals"
CASE this.activepage = 3
lcRectype = "_Tubular"
CASE this.activepage = 4
lcRectype = "_wellheads"
CASE this.activepage = 5
lcRectype = "_bits"
CASE this.activepage = 6
lcRectype = "_mud"
ENDCASE
This.activepage.recnew_grid11.recordsource = lcRecSource+lcRectype
This.activepage.recnew_grid11.Column1.ControlSource = lcRecSource+lcRectype+".hm"
This.activepage.recnew_grid11.Column2.ControlSource = lcRecSource+lcRectype+".cntr"
This.activepage.recnew_grid11.Column3.ControlSource = lcRecSource+lcRectype+".rcdate"
This.activepage.recnew_grid11.Column4.ControlSource = lcRecSource+lcRectype+".size"
This.activepage.recnew_grid11.Column5.ControlSource = lcRecSource+lcRectype+".weight"
This.activepage.recnew_grid11.Column6.ControlSource = lcRecSource+lcRectype+".ser"
This.activepage.recnew_grid11.Column7.ControlSource = lcRecSource+lcRectype+".desc"
This.activepage.recnew_grid11.Column8.ControlSource = lcRecSource+lcRectype+".qty"
This.activepage.recnew_grid11.Column9.ControlSource = lcRecSource+lcRectype+".unit"
This.activepage.recnew_grid11.Column10.ControlSource = lcRecSource+lcRectype+".vendor"
This.activepage.recnew_grid11.Column10.autofill_ven_grid1.ControlSource = lcRecSource+lcRectype+".vendor"
This.activepage.recnew_grid11.Column11.ControlSource = lcRecSource+lcRectype+".vdata"
This.activepage.recnew_grid11.Column12.ControlSource = lcRecSource+lcRectype+".vticket"
selRec = lcRecsource+lcRectype
SELECT &selRec
GO TOP
thisform.Refresh()