Article ID: 137626
Article Last Modified on 12/11/1999
OPEN DATABASE <<insert databasename here>>
WITH This
.Caption = ;
DBGETPROP( .Parent.Text1.ControlSource, ;
"FIELD", "CAPTION" )
ENDWITH
LOCAL iLoop, iMax, cSource
SET DATABASE TO <<insert databasename here>>
WITH This
&& Determine Number of Columns in Grid
iMax = .ColumnCount
&& Get the Table Name used by the Grid
&& This is necessary because unlike a text box control,
&& the ControlSource property of a column does not preface
&& the field name with the table name, so the code must
&& do this manually. Note that "." is included.
cSource = .RecordSource + "."
&& Loop through each column
FOR iLoop = 1 TO iMax
WITH .Columns(iLoop)
&& Set Header Caption
.Header1.Caption = ;
DBGETPROP( cSource + .ControlSource, ;
"FIELD", "CAPTION" )
ENDWITH
NEXT iLoop
ENDWITH
130997 How to Use the Caption Fields of a Table in a Form
Additional query words: VFoxWin
Keywords: KB137626