>I have placed a grid (grdGridCustom) control on the form, and edited the two columns to use CodeMine txtTxtBoxCustom controls per the doc's. I set lRefreshOnRowChange to .T. per doc's, and its cWorkArea to the child table. In column 1 I set the ControlSource to mychildtable.category. Would I set column 2 to mygrandchild.descript or what?
Make sure that your grid's recordsource is set to the child table. In column 2 of the grid, set its control source to a form.method you are going to create, say Thisform.grandChildDescript(). So, in column2's control source, literally type :- Thisform.grandChildDescript() - don't put quotation marks or anything like that around it. Create the form method and in it, type code similar to the following. Remember that I dont know what the relationship details are between the child and the grandchild tables but you can improvise.
if seek(mychildtable.categoryid, 'mygrandchild', 'categoryid')
return mygrandchild.description
endif
return ''
Remember that each row in the grid for a moment is the "current" row in the child table. When column #2 tries to evaluate the method name that is its control source, the method uses the child data in the "current" row to seek back to the related record in the grandchild table. So, for each row in the grid, a single seek() is performed on the related table. You cannot rely on the relationship between the cursors. You must seek (or locate) and return a value.
HTH
-=Gary