Article ID: 189128
Article Last Modified on 1/23/2007
APPLIES TO
- Microsoft Access 95 Standard Edition
- Microsoft Access 97 Standard Edition
This article was previously published under Q189128
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you use the BuildCriteria method, you may receive one of the following
errors:
Run-time error '2431': The expression you entered contains invalid
syntax. You may have entered a comma without a preceding value or
identifier.
Run-time error '2429': The In operator you entered requires
parentheses.
Run-time error '7956': The syntax of the subquery in this expression
is incorrect. Check the subquery's syntax and enclose the subquery in
parentheses.
CAUSE
You have used an SQL reserved word for the expression argument of the
BuildCriteria method. Specifically, you have used either the word "Select"
or "In" for your expression, as in the following example:
BuildCriteria("FieldName", dbText, "IN")
RESOLUTION
When you use the BuildCriteria method, enclose the expression in single
quotation marks, as in the following example:
BuildCriteria("FieldName", dbText, "'" & "IN" & "'")
STATUS
This behavior is by design.
REFERENCES
For more information about the BuildCriteria method, search the Help Index
for "BuildCriteria Method."
Also, please see the following articles in the Microsoft Knowledge Base:
170142 ACC: Issues When Using the BuildCriteria Method
178198 ACC97: Run-time error '2448' with BuildCriteria Method
Additional query words: prb filter criteria
Keywords: kbprb KB189128