>With Thisform > .LockScreen = .T. > .nVarID = ZONEGVAR.VAR_ID && all recs will have this PK > With .pgfMainPageFrame > With .Page3.grdVarZoneData > .FontSize = 8 > .RecordSource = "CENSUSZN" > .ColumnCount = Thisform.nFieldCount - 2 && This determined by counting the cols of the table > With .Columns(1) > .FontBold = .T. > .ControlSource = "CENSUSZN.ZONE" > .Header1.Caption = "Zone" > .Header1.FontBold = .T. > .Width = 33 > .Bound = .F. > With .text1 > .ControlSource = "CENSUSZN.ZONE" > .Visible = .T. > EndWith > EndWith > Select CENSUSZN > For lnColNo = 2 to thisform.nFieldCount - 2 > lcFieldName = ALLTRIM( FIELD( lnColNo + 2)) > lcFieldCapt = DBGETPROP( "CENSUSZN." + lcFieldName, "FIELD", "CAPTION") && Get field caption > With .Columns( lnColNo) > .Width = 66 > .FontBold = .T. > .ControlSource = lcFieldName > .Header1.Caption = lcFieldCapt > .Header1.FontBold = .T. > .Bound = .F. > EndWith && .Columns( lnColNo) > EndFor > EndWith && .Page3.grdVarZoneData > EndWith && .pgfMainPageFrame > .LockScreen = .F. >EndWith && Thisform >