Caption Property

Applies To

Command Button Control, Form, Label Control, Query Fields, Report, Table Fields, Toggle Button Control.

Description

You can use the Caption property to provide helpful information to the user through captions on objects in various views:

  • Fields — Specifies the text for labels attached to controls created by dragging a field from the field list and serves as the column heading for the field in table or query Datasheet view.
  • Forms — Specifies the text that appears in the title bar in Form view.
  • Reports — Specifies the title of the report in Print Preview.
  • Buttons and labels — Specifies the text that appears in the control.

Setting

Enter the caption text. Captions can have up to 2,048 characters. Captions for forms and reports that are too long to display on the title bar are truncated.

For controls, you can set this property in the property sheet. For fields, you can set this property in the property sheet in table Design view or in the Query window (in the Field Properties property sheet). You can also use a macro or Visual Basic. In Visual Basic, use a string expression to set the value of this property for forms, reports, and controls.

Remarks

If you don’t specify a caption for a table field, the field’s FieldName property setting will be used as the caption of a control or as the column heading. If you don’t specify the caption for a query field, the one for the underlying table field will be used. If you don’t set a caption for a form, button, or label, Microsoft Access will assign the object a unique name based on the object, such as “Form1”. If you create a control by dragging a field from the field list and haven’t specified a Caption property setting for the field, the field’s FieldName property setting will be copied to the control’s Name property box and will also appear in the label of the control created.

You can use the Caption property to assign an access key to a control. In the caption, include an ampersand (&) immediately preceding the character you want for an access key. The character will be underlined. When browsing the form, press ALT plus the underlined character to move the focus to that control.

Tip Include two ampersands (&&) in the setting for a control’s caption if you want to display an ampersand itself in the caption text. For example, to display “Save & Exit”, you should type Save && Exit in the Caption property box.

See Also

Description Property, Description Property (Microsoft Office 95 Data Access Reference).