Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Like' syntax help needed

Status
Not open for further replies.

VickyC

Technical User
Sep 25, 2010
206
CA
hi to all

I use a SQL statement as the RowSource of a ListBox. Here's a line used as I build up the SQL statement...

strSQLWhere = strSQLWhere & " AND ((" & strParts & "." & str1 & ") LIKE [txtSrch1]) "

The statement works fine, but I can't figure out the syntax of what to put into txtSrch1 to do the following: Select values that DO NOT begin with the @ symbol.

(w, T, UU should be included in the WHERE, but @R, @, @i should be excluded) I've tried lots of variations, but I can't seem to get the syntax right. txtSrch1 = "?????"

thanks for any help
Vicky
 



hi,
Code:
.... NOT LIKE '@%'



Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
[!@]*

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks Skip - the problem, though, is that I was hoping to keep the LIKE [txtSrch1] format. Most of the search criteria entered into txtSrch1, by code, are things I want to match (so I need LIKE...). If the value of txtSrch1 is '@*', for example, I want to find items that start with @. This works fine already. But what expression can be entered into txtSrch1 to match with items that can begin with anything EXCEPT @.?

Thank you, Vicky
 
Seems like you don't even tried my suggestion timestamped 26 Jul 11 10:34 ...
 
Thank you - I totally missed it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top