>thisform.grid1.column1.text1.ControlSource = "Table1.Name" >thisform.grid1.column2.text1.ControlSource = "Table2.family">into
>thisform.grid1.column1.ControlSource = "Table1.Name" >thisform.grid1.column2.ControlSource = "Table2.family">
>>>thisform.grid1.recordsource = "Table1">>>And note that you can simplify the table setup
>>>CLOSE DATABASES >>>USE "d:\00 vfp projects\alaki\table1.dbf" SHARED TAG Acode && In 0 not necessary since the last command closed the databases >>>USE "d:\00 vfp projects\alaki\table2.dbf" IN 0 SHARED TAG Acode >>>&& SELECT table1 - Not necessary since Table1 is already selected >>>SET RELATION TO Acode INTO table2>>>
>>>>************************************************** >>>>*-- Class: myclass (d:\00 vfp projects\alaki\rezaclass.vcx) >>>>*-- ParentClass: form >>>>*-- BaseClass: form >>>>*-- Time Stamp: 08/01/06 02:15:08 PM >>>>* >>>>DEFINE CLASS myclass AS form >>>> >>>> >>>> Top = 0 >>>> Left = 0 >>>> Height = 207 >>>> Width = 375 >>>> DoCreate = .T. >>>> Caption = "Form1" >>>> LockScreen = .F. >>>> Name = "form1" >>>> >>>> >>>> ADD OBJECT grid1 AS grid WITH ; >>>> ColumnCount = 2, ; >>>> DeleteMark = .F., ; >>>> GridLines = 3, ; >>>> GridLineWidth = 1, ; >>>> HeaderHeight = 20, ; >>>> Height = 120, ; >>>> Left = 37, ; >>>> RecordMark = .F., ; >>>> RecordSource = "", ; >>>> ScrollBars = 3, ; >>>> Top = 36, ; >>>> Width = 295, ; >>>> ForeColor = RGB(0,0,0), ; >>>> BackColor = RGB(255,255,255), ; >>>> GridLineColor = RGB(192,192,192), ; >>>> Name = "Grid1", ; >>>> Column1.ControlSource = "", ; >>>> Column1.ForeColor = RGB(0,0,0), ; >>>> Column1.BackColor = RGB(255,255,255), ; >>>> Column1.Name = "Column1", ; >>>> Column2.ControlSource = "", ; >>>> Column2.Width = 200, ; >>>> Column2.ForeColor = RGB(0,0,0), ; >>>> Column2.BackColor = RGB(255,255,255), ; >>>> Column2.Name = "Column2" >>>> >>>> >>>> ADD OBJECT myclass.grid1.column1.header1 AS header WITH ; >>>> Caption = "Header1", ; >>>> Name = "Header1" >>>> >>>> >>>> ADD OBJECT myclass.grid1.column1.text1 AS textbox WITH ; >>>> BorderStyle = 0, ; >>>> Margin = 0, ; >>>> ForeColor = RGB(0,0,0), ; >>>> BackColor = RGB(255,255,255), ; >>>> Name = "Text1" >>>> >>>> >>>> ADD OBJECT myclass.grid1.column2.header1 AS header WITH ; >>>> Caption = "Header1", ; >>>> Name = "Header1" >>>> >>>> >>>> ADD OBJECT myclass.grid1.column2.text1 AS textbox WITH ; >>>> BorderStyle = 0, ; >>>> Margin = 0, ; >>>> ForeColor = RGB(0,0,0), ; >>>> BackColor = RGB(255,255,255), ; >>>> Name = "Text1" >>>> >>>> >>>> PROCEDURE Init >>>> CLOSE DATABASES >>>> >>>> USE "d:\00 vfp projects\alaki\table1.dbf" IN 0 SHARED >>>> USE "d:\00 vfp projects\alaki\table2.dbf" IN 0 SHARED >>>> >>>> >>>> SELECT table2 >>>> SET ORDER TO TAG ACode >>>> SELECT table1 >>>> SET ORDER TO TAG ACode >>>> >>>> SET RELATION TO Acode INTO table2 >>>> >>>> >>>> thisform.grid1.column1.text1.ControlSource = "Table1.Name" >>>> thisform.grid1.column2.text1.ControlSource = "Table2.family" >>>> ENDPROC >>>> >>>> >>>>ENDDEFINE >>>>* >>>>*-- EndDefine: myclass >>>>************************************************** >>>>