Table of contents
Collapse the table of content
Expand the table of content

Textual Criteria Expressions

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

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 The single quotation marks indicate to 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 "Employees", CurrentProject.Connection,_ 
 dbOpenDynaset, adlockoptimistic) 
rst.Find "[LastName] = 'Buchanan'"
© 2018 Microsoft