Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Textual Criteria Expressions

Last modified: June 30, 2011

Applies to: Access 2013 | Office 2013

To specify textual criteria for an operation, you supply a text string as part of the string expression that forms the criteria argument. This text string must be enclosed in single quotation marks (').

Note Note

The single quotation marks indicate to Microsoft Access that the criteria argument contains a string within a string.

Suppose that you are using the ADO Find method to find the first occurrence of a last name in an Employees table. You could construct the criteria argument as in the following example, which moves the current record pointer to the first record in which an employee's last name is Buchanan. Note that the string literal is enclosed in single quotation marks and the entire string comprising the criteria argument must also be enclosed in double quotation marks (").

Dim rst As New ADODB.Connection 
 
rst.open "Employees", CurrentProject.Connection,_ 
 dbOpenDynaset, adlockoptimistic) 
rst.Find "[LastName] = 'Buchanan'"
Show:
© 2015 Microsoft