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!

Partial Search of Access Db from VB

Status
Not open for further replies.

ISDleftovers

Technical User
Dec 18, 2000
6
0
0
AU
I have a small application which needs to search through five fields and display the matching records to the user, at the moment the search works, but the user needs to enter the full name of a company to get any details at all.

I do not have the MSDN library and at the moment I am using the "Like" keyword, but this does not do partial matching (eg: to find ISD Consulting the user must enter "ISD Consulting" [case sensitive], I would like it to find ISD Consulting and other matches if "is" is entered)as I had hoped it would.

What keyword or function do I need to use instead of or with the "Like " keyword to make a partial search work.
 
This query works fine for me in access 2K:
SELECT user_.*
FROM user_
WHERE (((user_.Fnamn) Like "m*"));

The query is case insensitive.

Suggest that you try out how the qury should look in Access and then export it to the VB code.

I have never heard of a MS product that is case-sensitive, but that may well be something in the settings of youre DB, most likely nothing in youre VB code.

Good Luck
-Mats
 
You could try using the LIKE operator combined with the following pattern matching character; %


 
cool, thanks guys, I got it working,
my only problem is that it is still case sensitive and I can't find any reason for it to be
but at the moment just having it work as well as it does is fine, case insensitive would just be a bonus (really nice but not neccessary)

Thanks again
BJK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top