Microsoft KB Archive/102670: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 12: | Line 12: | ||
<div id="TitleRow"> | <div id="TitleRow"> | ||
= <span id="KB102670"></span>ACC: Filtering Form with OpenForm Action Causes | = <span id="KB102670"></span>ACC: Filtering Form with OpenForm Action Causes "#Name?" Error = | ||
Line 53: | Line 53: | ||
== SYMPTOMS == | == SYMPTOMS == | ||
A form that is opened with an OpenForm action that specifies a query for the Filter Name argument, may display a | A form that is opened with an OpenForm action that specifies a query for the Filter Name argument, may display a "#Name?" error message for some controls. | ||
</div> | </div> | ||
Line 60: | Line 60: | ||
== CAUSE == | == CAUSE == | ||
When a query is specified as the filter for the OpenForm action, the form is bound to the fields in the query. If the form contains controls bound to fields that are not included in the query, those controls display the | When a query is specified as the filter for the OpenForm action, the form is bound to the fields in the query. If the form contains controls bound to fields that are not included in the query, those controls display the "#Name?" error message. | ||
</div> | </div> | ||
Line 88: | Line 88: | ||
Field: Customer ID | Field: Customer ID | ||
Table: Customers | Table: Customers | ||
Criteria: Like | Criteria: Like "a*" | ||
</pre></li> | </pre></li> | ||
<li>On the View menu, click properties to verify that the Output All Fields property is set to No (or Restrict Available Fields check box in version 1.x is checked).</li> | <li>On the View menu, click properties to verify that the Output All Fields property is set to No (or Restrict Available Fields check box in version 1.x is checked).</li> | ||
Line 103: | Line 103: | ||
Filter Name: Filter Customers By Letter A | Filter Name: Filter Customers By Letter A | ||
</pre></li> | </pre></li> | ||
<li>Run the macro. Note that all the controls in the Customer form, except for [Customer ID], display the | <li>Run the macro. Note that all the controls in the Customer form, except for [Customer ID], display the "#Name?" error message.</li></ol> | ||
Line 130: | Line 130: | ||
== REFERENCES == | == REFERENCES == | ||
Microsoft Access | Microsoft Access "User's Guide," versions 1.0 and 1.1, pages 532-534, 558 | ||
</div> | </div> |
Latest revision as of 09:23, 20 July 2020
Article ID: 102670
Article Last Modified on 5/6/2003
APPLIES TO
- Microsoft Access 1.0 Standard Edition
- Microsoft Access 1.1 Standard Edition
- Microsoft Access 2.0 Standard Edition
This article was previously published under Q102670
Novice: Requires knowledge of the user interface on single-user computers.
SYMPTOMS
A form that is opened with an OpenForm action that specifies a query for the Filter Name argument, may display a "#Name?" error message for some controls.
CAUSE
When a query is specified as the filter for the OpenForm action, the form is bound to the fields in the query. If the form contains controls bound to fields that are not included in the query, those controls display the "#Name?" error message.
RESOLUTION
Switch to Design view and either change the query so that it contains all the fields used in the form or clear the Restrict Available Fields check box.
MORE INFORMATION
A similar behavior may occur with a report that is filtered by a query that does not contain all the same fields. The report gives parameter prompts for all fields not included in the query.
Steps to Reproduce Behavior
In the sample database NWIND.MDB, create a query called Filter Customers By Letter A based on the Customers table. Set the properties as follows:
Query: Filter Customers By Letter A ----------------------------------- Type: Select Query Field: Customer ID Table: Customers Criteria: Like "a*"
- On the View menu, click properties to verify that the Output All Fields property is set to No (or Restrict Available Fields check box in version 1.x is checked).
Create the following macro and call it Open Filtered Customers:
Macro Name Action ---------------------------------- Open Filtered Customers OpenForm Open Filtered Customers Actions ------------------------------- OpenForm Form Name: Customers Filter Name: Filter Customers By Letter A
- Run the macro. Note that all the controls in the Customer form, except for [Customer ID], display the "#Name?" error message.
WORKAROUND
- Open the Filter Customers By Letter A query in Design view.
- On the View menu, click Properties. Set the Output All Fields property to Yes (or clear the Restrict Available Fields check box in version 1.x).
- Choose OK and save the query. Note that the form now displays the correct values for all controls.
STATUS
This behavior no longer occurs in Microsoft Access version 7.0.
REFERENCES
Microsoft Access "User's Guide," versions 1.0 and 1.1, pages 532-534, 558
Additional query words: poundname
Keywords: kbfix kbprb kbusage KB102670