ACC2000: Option Group Label Can Only Be Re-Associated in HTML (203102)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q203102
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

Moderate: Requires basic macro, coding, and interoperability skills.

SYMPTOMS

When you create an option group on a data access page, a label, which is associated with the control, is also created. By default, this label is placed on the upper-left portion of the option group control. If you delete this associated label, no property is available that you can use to re-associate a new label. However, you can modify the HTML behind the page to associated a new label with the option group.

NOTE: The ChildLabel property, which is typically used to associate a label to a specific control is not available for the option group control.

RESOLUTION

The HTML code that forms an option group on a data access page uses the FIELDSET tag. To create an associated label for this option group, a LEGEND tag must be nested inside a FIELDSET tag. This process takes place automatically when you use the toolbox to place an option group on the page. However, you can also carry out this process manually by modifying the HTML source. For an example of how to do so, follow these steps:
  1. Open the sample database Northwind.mdb.
  2. In the Database window, click Pages under Objects, and then click New.
  3. In the New Data Access Page dialog box, click Design View, and then click OK.
  4. If the toolbox is not displayed, click Toolbox on the View menu.
  5. Add an option group to the page.
  6. By default, the name of the option group is Frame0, and the associated label's name is Frame0_Legend. Click Frame0_Legend, and then delete it.
  7. On the Tools menu, point to Macro, and then click Microsoft Script Editor.
  8. On the View menu, point to Other Windows, and then click Document Outline.
  9. Select the Body object in the Document Outline window.
  10. Locate the FIELDSET tag within the BODY tag in the Script Editor window. The FIELDSET tag is several lines down from the BODY tag. Insert the following inside of the FIELDSET tag:
    <LEGEND id=Label0 style="PADDING-LEFT: 1px">MyOptionGroup</LEGEND>
    					
  11. On the File menu, click Save.
  12. On the File menu, click Exit.

    Note that there is now a new label placed on the option group that displays the text, "MyOptionGroup."

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open the sample database Northwind.mdb.
  2. In the Database window, click Pages under Objects, and then click New.
  3. In the New Data Access Page dialog box, click Design View, and then click OK.
  4. If the toolbox is not displayed, click Toolbox on the View menu.
  5. Add an option group to the page.
  6. By default, the name of the option group is Frame0, and the associated label's name is Frame0_Label. Click Frame0_Label and delete it.

    Note that now there is no property available that you can use to re-associate a new label.

Modification Type:MajorLast Reviewed:6/28/2004
Keywords:kbbug kbDAP kbpending KB203102