>PUBLIC oform1 > >oform1=NEWOBJECT("form1") >oform1.Show >RETURN >************* >DEFINE CLASS form1 AS form > > > DoCreate = .T. > Caption = "Form1" > Name = "Form1" > > > ADD OBJECT grid1 AS grid WITH ; > ColumnCount = 3, ; > Height = 131, ; > Left = 48, ; > Top = 46, ; > Width = 309, ; > Name = "Grid1", ; > Column1.Name = "Column1", ; > Column2.Name = "Column2", ; > Column3.Name = "Column3" > > PROCEDURE Init > CREATE TABLE trans1 (bookno c(10),sticket c(10), eticket c(10),dummi c(30)) > INSERT INTO trans1 VALueS([1],[11111],[1111111],[dummi111]) > INSERT INTO trans1 VALuES([2],[22222],[2222222],[dummi222]) > > Select * from trans1 into cursor csrmyCursor readwrite where .F. > With thisform.Grid1 > .RecordSource = "csrMyCursor" > .Columncount = 3 &&& <---look this line > .Column1.ControlSource = "csrMyCursor.bookno" > .Column2.ControlSource = "csrMyCursor.sticket" > .Column3.ControlSource = "csrMyCursor.eticket" > ENDWITH > append blank > ENDPROC >ENDDEFINE >>
>> Select * from trans1 into cursor csrmyCursor readwrite where .F. >>With thisform.Grid1 >> .RecordSource = "csrMyCursor" >> .Column1.ControlSource = "csrMyCursor.bookno" >> .Column2.ControlSource = "csrMyCursor.sticket" >> .Column3.ControlSource = "csrMyCursor.eticket" >>ENDWITH >>USE cursor csrmyCursor >>append blank >>>>thanks.