You need two tables that looks like:
TblCategory
CategoryID
Category
TblBook
BookID
BookTitle
CategoryID
Create a query named QryBookSearch base on both tables. Include the fields:
BookID
BookTitle
Category
Set the Sort for BookTitle ascending.
Put the following expression in the criteria of BookTitle
Like "*" & Forms!FrmSearch!SearchForTitle & "*"
You need a form named FrmSearch.
1. Add a textbox named SearchForTitle to this form.
2. Put the following code in the AfterUpdate event of SearchForTitle:
Me!MyBookList.Requery
3. Add a textbox named BookCategory to this form.
4. Add a listbox named MyBookList to the form
a) Set the row source property of the listbox to QryBookSearch.
b) Set the bound column property to 1
c) Set the column count property to 3
d) Set the column width property to 0;1.5;0
5. Put the following code in the AfterUpdate event of MyBookList:
Me!BookCategory = Me!MyBookList.Column(2)
You will enter the title of the book you want to search for in
SearchForTitle. It doesn't have to be the full title. When you press enter,
the titles of all books that contain the words you entered in the textbox
will appear in the listbox. You will then be able to see if the book you are
looking for is in the database. When you select the book you are looking for
in the listbox, its category will appear in the BookCategory textbox.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
What I've been trying to do is create a search where a person can input a
title of a book and then it will come back telling you if the book is in
the
list and if it is which library and which category it is under. I also
want
this to be something I can link to on my switchboard. Can anyone help?