I'm lost trying to search (1 Viewer)

R

rob_oldflat

Guest
I'm in the process of setting up a simple database to list all the books, cd's, etc. in the library of a small medical practice.
I've got almost no experience with Access; The last time I set up a database was with a very easy DOS-based program (Alpha4).
The main table has about 10 fields. What I want to do is set up some search facilities for the staff (some of whom are quite intimidated by computers) so that they can list just the titles they have to find. I would like to set up three different searches they could easily bring up, listing only the records that pertain to that search: One search by author name, another by title, and a third by category.
Can anyone show me a simple way to do this?
Many thanks,
Rob
 

RobertQ

Registered User.
Local time
Today, 04:20
Joined
Jan 8, 2003
Messages
10
Hi Rob,

the simpliest way is to create a parameter query.
Create a query and as criterion for the author name you put in

Like "*" & [Which author name do you look for] & "*"

The same for title and category.

You can do this in one query. If, for example the author is left blank and only quit by enter all authors will appear in the query result.

Kind regards
 

WayneRyan

AWF VIP
Local time
Today, 04:20
Joined
Nov 19, 2002
Messages
7,122
Rob,

Another method that you can use is to make three
unbound textboxes.

Set the rowsource for your form to:

"Select * " & _
"From YourTable " & _
"Where (Title like '*" & Me.txtTitle & "*' Or " & _
IsNull(Me.txtTitle) & ") And " & _
"(Author like '*" & Me.txtAuthor & "*' Or " & _
IsNull(Me.txtAuthor) & ") And " & _
"(Category like '*" & Me.txtCategory & "*' Or " & _
IsNull(Me.txtCategory) & ");"

The on the AfterUpdate event on any of your
three new textboxes:

Me.Requery
Me.Refresh

This will allow your users to type parts of Author's
names in conjunction with parts of titles and
get the desired results.

Wayne
 

Users who are viewing this thread

Top Bottom