TempDBF="C:\TEMP\TEMP.DBF" thisform.GridRefreshing = .T. close tables copy file (SourceDBF) to (TempDBF) use (TempDBF) again alias "MyAlias" with thisform.MyGrid .RecordSource = "MyAlias" && should be alias, not the PathName of the DBF file && I want the 4 columns to show field 1,3,5,7 of the table: .column1.controlsource="MyAlias.Field1" && "alias.field", otherwise grid will be lost as soon as current alias changes .column2.controlsource="MyAlias.Field3" .column3.controlsource="MyAlias.Field5" .column4.controlsource="MyAlias.Field7" endwith thisform.Refresh DOEVENTS thisform.GridRefreshing = .F. thisform.Refresh && one more refresh thisform.MyGrid.SetFocus>Hi Vlad,
>TempDBF="C:\TEMP\TEMP.DBF" > >thisform.GridRefreshing = .T. > >close tables >copy file "&SourceDBF" to "&TempDBF" >use &TempDBF > >with thisform.MyGrid > .RecordSource = "&TempDBF" > && I want the 4 columns to show field 1,3,5,7 of the table: > .column1.controlsource="Field1" > .column2.controlsource="Field3" > .column3.controlsource="Field5" > .column4.controlsource="Field7" >endwith > >thisform.Refresh >DOEVENTS >thisform.GridRefreshing = .F. >>