ACC97: Run-time error '2448' with BuildCriteria MethodLast reviewed: December 17, 1997Article ID: Q178198 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. When you use the BuildCriteria method in Microsoft Access 97 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. CAUSEThe 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.
RESOLUTIONTo resolve this behavior, enclose the Field argument of the BuildCriteria method within brackets. For example, using the example from the "More Information Section" below, the following expression
strFilter = BuildCriteria("Product Name", dbText, strInput)should be entered as follows:
strFilter = BuildCriteria("[Product Name]", dbText, strInput) MORE INFORMATION
Steps to Reproduce Behavior
Creating the Form
Creating the Module
REFERENCESFor more information about using the BuildCriteria method, search the Help index for "BuildCriteria" or ask the Microsoft Access 97 Office Assistant.
|
Additional query words: error searching filtering
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |