Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help - view records based on user's selection(s)

Status
Not open for further replies.

DonnaPwll

IS-IT--Management
Aug 12, 2003
1
US
What is the best way to do the following?
I need to allow users to view customers in a specific state and/or state and city and am not sure how to do this.
Example:
User selects state from list box.
User selects cities within that state or all cities from a list box.
User see customers based on selections.
User can preview or print the report.

Any help will greatly be appreciated!
Thanks,
Donna
 
1) I do this by having an unbound form with various drop down menus (state, city, etc).

I call mine "ReportGenerator" (very original name)

The user selects the criteria they want on the ReportGenerator.

2) The values selected from the drop down menus are used as criteria in a query.

Example from my query:

Like IIf([Forms]![frmReportGenerator]![HomeDepartmentChooseBox] Is Null,"*",[Forms]![frmReportGenerator]![HomeDepartmentChooseBox])

This code brings up all records if nothing is selected from the drop down named "HomeDepartmentChooseBox" OR it brings up what is actually selected.

3)The query is used to genrerate a report.

I use the pop-up feature to make the report appear on top of the form "ReportGenerator" I also maximize the report.

From there your users can print the info.

Hope this helps.

 
Hi Donna,

I think you are looking for same as I written in this FAQ faq702-3924

Please go through this FAQ and if you needs more help I will help you by posting on Forum.


Hope this helps... :)
Hasu
(Trust on someone, someone will trust you!)
 
Assuming states and cities are in a table...

set rowsource of state list box to retrieve state names

set rowsource of cities list to retrieve city names; in QBE panel, select cityname and statename, uncheck show in state name and set criteria to Forms!Yoursearchform!statelistboxname
Note, you may need to group to prevent duplication of values

Build query that contains all the info you want to see from your hit set and set the the criteria in state and city columns to Forms!yoursearchform!listboxname

Set the recordsource of the data display form to the query you just created. You can do the same to the report recordsource to print it.

There are some good faqs in this forum, the access queries forum, and the access modules forum for more info and adding additional features.

Good Luck

Shane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top