Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 204204 - Last Review: June 29, 2004 - Revision: 2.0
ACC2000: Option Buttons on a Data Access Page Must Have Name and ID Property Values
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).
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.
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.
- 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>
- 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>
- On the File menu, click Save.
- On the File menu, click Close to close the Microsoft Script Editor.
- On the View menu, click Page View. Note that the option button on the page is now selectable.
Steps to Reproduce the Behavior
- 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 View menu, click Page View.
Note that when you try to select the option button, nothing happens.
APPLIES TO
- Microsoft Access 2000 Standard Edition
| kbdap kbprb kbpending KB204204 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate