Form for searching database?

F

FormforSearching

Hi,
I have a large list of resources that has been categorized by topic,
audience, type, language and availability. I would like to know if it is
possible to create a form where a person can enter what they are looking for
(e.g., specificy the topic, language and availability) and somehow have
Access return a report of what resources match the desired criteria.
Any help is greatly appreciated.
Thanks,
Julie
 
A

Allen Browne

If you just want to choose *one* field to filter on, and narrow it down as
you go, see:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html

If you want to let the user enter any combination of topic, audience, type,
language and availability, see:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

The first one is copy'n'paste stuff. The 2nd one is an example of how to
write the code for a flexible search.

Both examples filter a form. Once you have that working, you can use the
form's filter as the WhereCondition for OpenReport.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
F

FormforSearching

The second option is just what I need, but I do have a question:

Some resources may be appropriate for multiple audiences (e.g., adults,
families, seniors,...). Currently I have been capturing this as multiple
yes/no fields. Is it possible for the user to select the audience from a
drop down list (e.g., Audience = Adults) and have the search return the
entries where Adult=Yes?
 
A

Allen Browne

Yes: you could create a combo with the 3 choices, and then write your code
so that it add the appropriate thing to the filter string, e.g.:
If Not IsNull(Me.cboAgeGroup) Then
strWhere = strWhere & "(" & Me.cboAgeGroup & " = True) AND "
End If

However, it might be a better design to create a related table where you can
store 3 records if all 3 age groups apply. Details in:
Don't use Yes/No fields to store preferences
at:
http://allenbrowne.com/casu-23.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
 

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