HOW TO
The "expression" argument for the SearchExpression method requires an SQL WHERE clause formatted string in order to return an appropriately filtered Recordset. By default, when querying string fields, the value included in the WHERE clause must be a string that has characters which match the case of the characters in the Recordset.For example, "STATE_NAME = 'new jersey'" will not retrieve the New Jersey record if the value in the STATE_NAME field is stored in all upper case, or proper case; for example, "New Jersey".This document provides two possible solutions for building case-insensitivity into an application.
Code:
strField = txtFieldName.Text
strValue = txtQueryValue.Text
strWhere = strField & " = '" & strValue & "' OR " & _
strField & " = '" & UCase(strValue) & "' OR " & _
strField & " = '" & LCase(strValue) & "' OR " & _
strField & " = '" & StrConv(strValue, vbProperCase) & "'"
Set recs = mlyr.SearchExpression(strWhere)
Code:
strField = txtFieldName.Text
strValue = UCase(txtQueryValue.Text)
strWhere = strField & " = '" & strValue & "'"
Set recs = mlyr.SearchExpression(strWhere)
Article ID:000005666
Get help from ArcGIS experts
Download the Esri Support App