How can I report based on specific fields?

viperstingray

Registered User.
Local time
Yesterday, 16:44
Joined
May 31, 2005
Messages
87
My database tracks clients, their facilities and work that was done to them. I have created a report that is predetermined but it reports on ALL clients. How would I be able to have the user select a specific client and get MS Access to generate a report based on ONLY that client and their respective facilities or even allow the user to report on only one facility for one client. You help is appreciated.

I am not using queries in my database, I hope I don't have to.
 
Well it seems that your issue is related to queries. How are you not using queries in your database? Most of your reports and forms should be based off of queries as this helps protect your tables and makes your data much easier to access and manipulate.

If you want to print the report based on one person, you should base the report on a query and have the query get the persons unique identifier from another form or input box.

You can also use the filter property and have the filter set the unique indentifier of the individual equal to the value given by a form. Create a form with a combo box or list box or text box (text boxes don't typically work well here as you may have duplicate names or mispellings). The combo box or list box should show the names available and have a bound column which houses the unique indentifier. Have a button on your form which opens the report and sets the filter property to:
Code:
"[UniqueID] = " & Me.ComboBox.Column(#)

Where "UniqueID" is the unique id field in your table (I assume your report is based on a table) and ComboBox is the name of your field in the form. # next to "Column" should be the column that contains your unique id in the form (starting with zero being the first column).

Does this help or do you need more specifics?
Keith

P.S.: the code above will only work using VBA, if you don't want to use VBA then post again and we'll give you the code for that.
 
I Am Confused...

I have two main tables. One provides the basics about that client and that facility (name, ID, adress, and some figures regarding their usage of certain utilities), the second table stores more details about that customer and that specific facility.

I now have a form that has a "gnerate report" button on it. Clicking that button generates a report based on ALL my entries in the data base. On that same form, I have two cascading combo boxes, one has client name and the other contains all facilities for that client. I would like the user to be able to make a selection (ex: MICROSOFT & California). When those fields have been chosen, A report is to be generated that ONLY includes the "MICROSOFT CALIFORNIA" facility. I hope this helps you help me.
 
In the query that your report is base on, or better still, the reports under laying query.

In the criteria under under your CompanyName put =Forms![YourFormName].[YourCompanyComboBoxName]

In the criteria under your LocationName =Forms![YourFormName],[YouLocationComboBoxName]

This should do what want
 

Users who are viewing this thread

Back
Top Bottom