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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Free search string in query?

Status
Not open for further replies.

PLiNk

IS-IT--Management
Apr 12, 2003
32
NO
Hello, I am making a database for an organisation that are archiving sheetmusic and scores for choires. In the future people will be coming in and searching different things about the score. I already the capability to search on people and on title.
What I need is a free search string so that if a score is made for two tenor lines and two base lines (TTBB), when people search for TTBB, then every record with TTBB in it appear, for instance" "SSAATTBB" and "STTBB" or "TTBB with piano" in addition to the TTBB records themselves. The way i am doing it now only TTBB records appear, and this is not good enough since the amount of data is limited and therefore people could well make do with a little extra records.

Jens
 
Hi

Perhaps using Like opertaion would help

eg Like "*TTBB*" would find anything containing TTBB

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
That simple?
But how would I make it so that those two asteriks doesn't have to be written? And how would I do it if I wanted to have many such search functions referring to say an array of textboxes on a form so that:
When the a textbox contains a value, this value will be compared to records in the dataset and only the records which fulfill the criteria (like [Textbox]) will show. But when this textbox is empty, (contains nothing or, you know, NULL) how can I make this part of the query autorize all records for display, instead of none.

Really appreciate it.

 
In your query, use like as suggested above, but code it like this: like "*" & forms!yourform.Yourtextbox & "*"

This way, if it is empty, it returns everything. If it has something, it only returns the matches.



Ascii dumb question, get a dumb Ansi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top