Microsoft KB Archive/204204

= ACC2000: Option Buttons on a Data Access Page Must Have Name and ID Property Values =

Article ID: 204204

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q204204



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

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



SYMPTOMS
When you add an option button to a data access page as a stand-alone control, you are not able to select the button by default. For an option button to work correctly, you must set a value for both the ID and Name properties. When you create an option button from the toolbox in the Design view of a page, the Name property is not automatically set. You must modify the HTML source that defines the option button to include a Name attribute. After you have done so, the option button will become selectable.



RESOLUTION
For an example of how to modify the HTML source for an option button, 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 new option button to the page. 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.</li>  Browse through the Document Outline window to the Option0 control, and then select the control.

Note that the Script pane contains code similar to the following HTML that defines the Option0 control: <INPUT id=Option0 style="HEIGHT: 0.166in; LEFT: 1.375in; POSITION: absolute; TOP: 1.166in; WIDTH: 0.18in" tabIndex=1 title=Option0 type=radio> </li>  Modify the HTML by adding a name attribute. For example, to the code from the previous step, note how a name attribute (name=Option0) is added: <INPUT id=Option0 name=Option0 style="HEIGHT: 0.166in; LEFT: 1.375in; POSITION: absolute; TOP: 1.166in; WIDTH: 0.18in" tabIndex=1 title=Option0 type=radio> </li> On the File menu, click Save.</li> On the File menu, click Close to close the Microsoft Script Editor.</li> On the View menu, click Page View. Note that the option button on the page is now selectable.</li></ol>

<div class="moreinformation_section">

Steps to Reproduce the Behavior

 * 1) In the Database window, click Pages under Objects, and then click New.
 * 2) In the New Data Access Page dialog box, click Design View, and then click OK.
 * 3) If the toolbox is not displayed, click Toolbox on the View menu.
 * 4) Add a new option button to the page.
 * 5) On the View menu, click Page View.

Note that when you try to select the option button, nothing happens.

Additional query words: prb

Keywords: kbdap kbprb kbpending KB204204

-

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

© Microsoft Corporation. All rights reserved.