The information in this article applies to:
SUMMARYThe Database Container allows you to enter captions for the fields of a table. However, there is no FieldCaption control that you can place on a form to display a field's caption or to automatically update a field's label on the form should you choose to change the field's caption in the database header. The examples in this article show you how to use DBGETPROP to create a link between field labels on a form and the field captions in the database so that changes propagate. MORE INFORMATIONExample One: Setting the Label for a Standard Text Box Field
Example Two: Setting Headings of a GridNormally, a grid with a ColumnCount of -1 will use the Caption property to detrmine the headings used for columns. However, if you specify the number of columns, the headings are determined by the Caption of the header object, not by the Caption property of the ControlSource field. The following code placed in a grid's Init event will set the grid headings when an instance of the grid is created:
Example Three: Using Captions in Report HeadersTo use field captions in reports, create a field (not a text label) whose expression is DBGETPROP("tablename.fieldname","FIELD","CAPTION").NOTE: Here tablename.fieldname is the actual name of the table and field. When the report runs, the expression will evaluate to the proper caption. REFERENCESFor additional information, please see the Visual FoxPro Help file, the Developer's Guide, and the following article in the Microsoft Knowledge Base: Q130997 How to Use the Caption Fields of a Table in a Form Additional query words: VFoxWin
Keywords : |
Last Reviewed: December 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |