Search Field

E

eagles73

What I am looking for is the ability to search a field in my table for any
part of a keyword. My SQL is:

SELECT tblProjects.[M & P Search Topics], [tblM&PContacts].[M&PContactsID],
[tblM&PContacts].Name, [tblM&PContacts].Position, tblOffices.Office
FROM tblProjects, tblOffices INNER JOIN [tblM&PContacts] ON
tblOffices.OfficeID = [tblM&PContacts].OfficeID
WHERE (((tblProjects.[M & P Search Topics]) Like "*"))
ORDER BY tblProjects.RequestNumber DESC;

The LIKE operator starts at the beginning of the field and I would like to
search any part of the field. Such as if my field contained "toy,cable" and
I typed in "c" in my search then I would like to have it bring up the 'c' in
cable and so forth. Is that possible using SQL?
 
E

eagles73

Search box is a text box that i created where this SQL is applied to. The
Keyword field is located in my table which has a keywords field with each
record for searching purposes. We insert keywords pertaining to the record
and i am trying to use those for searching records with a particular keyword.
I am looking for something that will search the entire keywords field not
just start at the beginning. Does that help?
 
A

Andi Mayer

Search box is a text box that i created where this SQL is applied to. The
Keyword field is located in my table which has a keywords field with each
record for searching purposes. We insert keywords pertaining to the record
and i am trying to use those for searching records with a particular keyword.
I am looking for something that will search the entire keywords field not
just start at the beginning. Does that help?
I am still confused:

is the searchbox a comboBox?
if yes then the rowsource should be:
SELECT Keyword, primarykeyfield from MyTable ORDER BY Keyword

the auto expand set to yes
the columncount to 2
the column width to xxxx;0

now when you type c it jumps to the first c, if you type then a it's
jumps to the first keyword with a. (cable)

now I can use in the afterUpdate event

with me.recordsetclone
.findfirst "primaryKeyField=" &me.combobox.column(1)
if not .nomatch then me.bookmark=.bookmark
end with
 
E

eagles73

yes it is a combo box. i will try what you suggested and will let you know.
thanks for your help.
 
Top