Microsoft KB Archive/207744

= HOW TO: Change the Caption of a Control on a Data Access Page in Access 2000 =

Article ID: 207744

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q207744



Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

IN THIS TASK
SUMMARY
 * Method 1: Changing the InnerText Property of the Control
 * Method 2: Directly Editing the Control
 * Method 3: Editing the Underlying HTML That Defines the Control



SUMMARY
This article describes three methods that you can use to change the caption of a control on a data access page. These three methods are:
 * Changing the InnerText property of the control
 * Directly editing the control
 * Editing the underlying HTML that defines the control

NOTE: Not all controls have an InnerText property that you can modify. The controls that do have an InnerText property are as follows:
 * Label
 * Marquee
 * Bound HTML
 * Option Button
 * Check Box
 * Command Button

back to the top

Method 1: Changing the InnerText Property of the Control
On a data access page, the InnerText property of a control is the equivalent of the Caption property of a control on a form. To change the value of the InnerText property for a control on a data access page, follow these steps:
 * 1) Open the data access page in Design view.
 * 2) Select the control whose caption you want to change.
 * 3) If the property sheet is not already displayed, click Properties on the View menu.
 * 4) Click the Other tab, and then change the value of the InnerText property.

back to the top

Method 2: Directly Editing the Control
You can also edit the control directly. To do so, follow these steps:
 * 1) Select the control whose caption you want to change.
 * 2) Click inside the control.
 * 3) Type the text that you want.

back to the top

Method 3: Editing the Underlying HTML That Defines the Control
You can also edit the HTML tags that define the control. Each control on a data access page is defined by the HTML tags behind the page. Although you can change most of the properties for each control through the property sheet of that control, you can also change the properties by directly editing the HTML. For an example of how to do so, follow these steps:  In the Database window, click Pages under Objects, and then click New. In the New Data Access Page dialog box, click Design View, and then click OK. If the toolbox is not displayed, click Toolbox on the View menu. Add a label control to the data access page, click inside the label control, and then change the text to CategoryID. On the Tools menu, point to Macro, and then click Microsoft Script Editor. On the View menu, point to Other Windows, and then click Document Outline.  Select the control that you want in the Document Outline Window. This puts the focus on the HTML tags that make up the control in the Editor pane. The following is sample HTML code for a label control: <SPAN class=MSTheme-Label id=Label0 style="HEIGHT: 16px; LEFT: 2.208in; OVERFLOW: hidden; PADDING-LEFT: 1px; POSITION: absolute; TOP: 0.5in; WIDTH: 96px" title=Label0><P>CategoryID</P><P>&#xa0;</P></SPAN>

</li> The text between the HTML tags, in this case CategoryID, is the caption for the control. Change this text to the text that you want.</li> Save your changes, and then quit the Script Editor. Note that the caption reflects the change that you made to the HTML code.</li></ol>

back to the top

Additional query words: inf Inner Text

Keywords: kbhowto kbhowtomaster kbdap KB207744

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.