Search criteria (1 Viewer)

llkhoutx

Registered User.
Local time
Today, 02:54
Joined
Feb 26, 2001
Messages
4,018
I have text data containing a single quote ("), a tic mark (') and/or a # and must fileter for same.

Example data might be: the string 2.5" x 4.0' x 12'. The only way I can filter for this value using a vba string filter is to use a wild card for the quote and the tic.

Any suggestions as to how to do this without th wild card?

Thank you in advance for your suggestions.
 

WayneRyan

AWF VIP
Local time
Today, 08:54
Joined
Nov 19, 2002
Messages
7,122
llkhoutx,

In the query grid:

Like "*[#]*" <-- pound sign
Like "*" & Chr(34) & "*" <-- double-quote
Like "*'*" <-- single-quote

On the surface, I think those would work in VBA also.

hth,
Wayne
 

llkhoutx

Registered User.
Local time
Today, 02:54
Joined
Feb 26, 2001
Messages
4,018
Thank you for your response.

My problem more particularily is that a string variable whose value is like

"2.5" X 7' X 600#", without the enclosing quotes.

Cancantenating that variable into a SQL string generates a error when the SQL string is executed. I presently use the Replace function to change "'", """, and/or "#" with a "?" (each without the quotes) for fuzzy searching.

I'll try replacing those values with the ASCII code.

It's just a royal pain.

Thanks again.
 

MSAccessRookie

AWF VIP
Local time
Today, 03:54
Joined
May 2, 2008
Messages
3,428
ASCII Character Substitution is the way to go.

" = chr(34)
# = chr(35)
' = chr(39)
 

Users who are viewing this thread

Top Bottom