Search function on a form

G

Guest

Hello all,

I have a database that stores the information on books. One of the forms in
the database is used to search for a book. One of the fields on that form is
a contents field. What I like to do is to have the form brings up a list of
records that meets the keyword keyed by the user. For example,

Book 1 Contents: Drama, action, etc.
Book 2 Contents: Comedy and action
Book 3 Contents: Drama comedy

So when the form is open and prompt for the contents criteria and if I type
in "drama" or "drama*", the form would bring up the records of Book 1 and
Book 2.

Please help. Can it be done?
 
G

Guest

Do your descriptive words appear in one field, several fields, or does each
word appear in a separate record?

I would go for the last then you can simply filter the record and list all
the relevant books.
 
G

Guest

Thanks for your response. If I understand you question correctly, I have a
field called "contents". The field contains the content information of a
book, and there are thousands of books in the database. What I am hoping to
do is to have a search feature on a form of the contents field, like keyword
search. For example, when the users type in (search for) a keyword of
"action", the form will show all the records (books) on the form.

Thanks.
 
G

Guest

You haven't said whether you have designed this database yourself or it has
been passed on to you. If the information hasn't been entered systematically
or using some consistent method then I think you might find it quite
difficult. I am not an expert on this kind of search function (sorry!).

The only thing I seem to recall from other posts is that you can use the
asterisk to look for keywords in a text field using the Like function (so you
aren't far off). Search for "text search" in the query forum and you will get
a few ideas.

It would be better (IMO) to have a 1-to-many relationship then each book can
have many genres and they can be held as records. The field would be a combo
box that lists all the various words you might want to use (and you can use
the not-in-list event to add words to the table). In a query list it would
look something like this

book keyword
1 Drama
1 Action
2 Comedy
2 Action
3 Drama
3 Comedy

When you put a filter in the query for each keyword:

"drama" - books 1 and 3
"action" - books 1 and 2
"comedy" - books 2 and 3

Though the downside is to make sure that the keyword isn't repeated for one
book.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top