ACC2002: At Sign in RecordSource Property Causes Error Message (287454)
The information in this article applies to:
This article was previously published under Q287454 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access project (.adp).
SYMPTOMS
When you create a form or a report where the RecordSource property is set to a SELECT statement containing the at sign (@) in the WHERE condition, you receive an error message similar to this one:
Closing delimiter not found for the string beginning at position 56 in the command. The string begins with: '? }) AS RS_37.
NOTE: The position number and the number at the end of the error message may vary.
CAUSE
Microsoft Access incorrectly evaluates the at sign in a string literal to be a parameter sign and subsequently executes the SELECT statement as a parameter query.
RESOLUTION
Replace the SELECT statement in the RecordSource property of your form or report with a view based on the same SQL statement.
To change the RecordSource property from a SELECT statement to a view, follow these steps:
- Open your form or report in Design view.
- Press CTRL+R to select the form or report. On the View menu, click Properties.
- Click the Data tab of the Properties dialog box.
- Select the entire contents of the RecordSource property and press CTRL+C to copy the selection to the Clipboard.
- Close the form or report.
- Click Queries in the Database window, and then click New.
- Select Design View, then click OK.
- Click Close in the Add Table dialog box, and then click SQL on the toolbar.
- Delete any text automatically inserted in the SQL Text Editor. On the Edit menu, click Paste.
This step inserts the text you copied in step 4. - Save and close the view.
- Repeat steps 1 to 3 to open the form or report's Properties dialog box.
- Replace the contents of the RecordSource property with the name of the view you created in step 10. Close the Properties dialog box, and then open the form or report in Datasheet view.
The form or report should open without error, and any records matching your criteria are found.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. REFERENCESFor more information about the RecordSource property, click Microsoft Access Help on the
Help menu, type RecordSource in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.
Modification Type: | Major | Last Reviewed: | 11/5/2003 |
---|
Keywords: | kbbug kberrmsg kbnofix KB287454 |
---|
|