ACC97: Run-time error '2448' with BuildCriteria Method (178198)
The information in this article applies to:
This article was previously published under Q178198 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you use the BuildCriteria method to programmatically set the Filter
property on a form and the Field argument of the BuildCriteria method
references a field name that contains a space, you may receive the
following error message:
Run-time error '2448':
You can't assign a value to this object.
CAUSE
The BuildCriteria method is used to generate a parsed criteria string as it
would appear in the Query by Example (QBE) grid or in Filter By Form mode.
Unlike the QBE grid or Filter By Form, however, the BuildCriteria method
does not automatically enclose the field name within brackets.
RESOLUTION
To resolve this behavior, enclose the Field argument of the BuildCriteria
method within brackets. For example, using the example in step 2 of the
"Creating the Module" section of the "Steps to Reproduce Behavior section"
later in this article, enter the following expression
strFilter = BuildCriteria("Product Name", dbText, strInput)
as follows:
strFilter = BuildCriteria("[Product Name]", dbText, strInput)
REFERENCES
For more information about using the BuildCriteria method, search the Help
index for "BuildCriteria" or ask the Microsoft Access 97 Office Assistant.
Modification Type: | Major | Last Reviewed: | 9/25/2003 |
---|
Keywords: | kberrmsg kbprb KB178198 |
---|
|