.Columns(nColIndex).ControlSource = cFieldto
.Columns(nColIndex).ControlSource = "MyTable."+ m.cFielde.g. specify controlsource in Table.field form
>>>*--Form init which populates the grid >>>DODEFAULT() >>> >>>thisform.setgridsource('insured') >>>thisform.cleargridfields >>> >>>thisform.addgridfield(1, 'insured.po_name', 30, 'Name', '') >>>thisform.addgridfield(2, 'accounts.po_acct', 15, 'Account#', '') >>>thisform.addgridfield(3, 'accounts.po_pmt', 13, 'Payment', '@z 9,999,999.99') >>>thisform.addgridfield(4, 'accounts.po_due', 12, 'Due Date', '') >>>thisform.addgridfield(5, 'accounts.po_pmtdat', 12, 'Last Pmt', '') >>>thisform.addgridfield(6, 'insured.po_sysnum', 10, 'Profile#', '9999999999') >>> >>>thisform.caption = "PREMIUM FINANCE ACCOUNTS WITH: "+xcomname >>>>>>
>>>*--addgridfield method of baseform >>>LPARAMETERS nColIndex, cField, iWidth, cHeading, cMask >>>*---Add a Column to the grid >>> >>>IF TYPE('thisform.currentgrid') = 'O' >>> >>> WITH thisform.currentgrid >>> >>> .AddColumn(nColIndex) >>> .Columns(nColIndex).ControlSource = cField >>> .Columns(nColIndex).Width = (( FONTMETRIC(6, 'Arial', 9) + 2) * iWidth ) >>> >>> *---Remove default header and create a custom header >>> *---so when can get to the header.click event. >>> >>> .Columns(nColIndex).RemoveObject('Header1') >>> .Columns(nColIndex).NewObject('custHeader1', 'custHeader', 'custHeader.prg') >>> .Columns(nColIndex).custHeader1.caption = cHeading >>> >>> IF !EMPTY(cMask) >>> .Columns(nColIndex).InputMask = cMask >>> ENDIF >>> >>> ENDWITH >>> >>>ENDIF >>>