Local ix For ix=1 To Reccount() With Getpem(Thisform, 'Dayjobsline'+Ltrim(Str(m.ix))) .Visible=.T. * any other propery get/set or method call Endwith EndforAs per displaying data, it depends on what kind of an object that is. If say, it is an object with a ControlSource property, you could scatter the records to an array and bind array objects as controlsources (and gather if would be saved). ie:
If Reccount() > 0 AddProperty(Thisform, Textmerge('aRecords[<< RECCOUNT() >>]')) Scan Scatter Name Thisform.aRecords[RECNO()] Memo With Getpem(Thisform, 'Dayjobsline'+Ltrim(Str(Recno()))) .Visible=.T. .ControlSource = Textmerge('(thisform.aRecords[<< RECNO() >>].MyField)') Endwith Endscan EndforA more detaied sample might be:
Select Top 5 * From (_samples+'data\customer') Order By cust_id Into Cursor crsTest Readwrite Use In 'customer' Public oForm oForm = Createobject('Myform') oForm.Show() Define Class myForm As Form Add Object btnFillCustom As CommandButton Add Object Dayjobsline1 As TextBox With Top= 40, Left = 10, Visible=.F. Add Object Dayjobsline2 As TextBox With Top= 70, Left = 10, Visible=.F. Add Object Dayjobsline3 As TextBox With Top=110, Left = 10, Visible=.F. Add Object Dayjobsline4 As TextBox With Top=140, Left = 10, Visible=.F. Add Object Dayjobsline5 As TextBox With Top=170, Left = 10, Visible=.F. Procedure btnFillCustom.Click Select crsTest If Reccount() > 0 AddProperty(Thisform, Textmerge('aRecords[<< RECCOUNT() >>]')) Scan Scatter Name Thisform.aRecords[RECNO()] Memo With Getpem(Thisform, 'Dayjobsline'+Ltrim(Str(Recno()))) .ControlSource = Textmerge('(thisform.aRecords[<< RECNO() >>].Company)') .Visible=.T. Endwith ENDSCAN this.Enabled = .F. Endif Endproc EnddefinePS: A question would be, why not a grid.