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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am helping one of my clients to s

Status
Not open for further replies.
Mar 1, 2003
853
US
I am helping one of my clients to setup a network. He asked me how to view or print a report based on one of categories.

He has a contact table and each contact is assigned a certain category such as business, vendor, client. He would like the report to give him the option to SELECT (no typing) one category and list all contacts belonging to the category. How can he do this?

Robert Lin, MS-MVP, MCSE & CNE
Windows, Network and How to at
 
Set the client up with a combo box that lists all the Categories. Then in the After Update event for the combo put
DoCmd.OpenReport "ReportName",acViewPreview,,"[Category] = '" & Me.ComboboxName & "'"

Then in the Report add a Group Header and put Category in the header and in the Detail Section add a textbox for Contacts. That will give you want you want.

Paul


 
Hi Paul,

Thank you for the help.

1. combo box: where does he need to create combo box, table, query or report?

2. After Update: I tried to create a conbo box in table. When I opened the properties, I could not find After Update. Where is After Update?

3. Group Header: how do you add Group Harder on a report?

Robert Lin, MS-MVP, MCSE & CNE
Windows, Network and How to at
 
The combo box would have to go on a form. Click on the Row Source line. Click on the three dot button... This will bring up a query grid. Add the Contacts table and select Catagory from the Table. Close it out and save it.
Then in the property box for the Combo, you will find an AfterUpdate Event. Click on the line next to that event. You will see the box with three ... in it. Click on that. Select Code Builder and click OK. That will bring up the After Update Event. Then put your code in that Event.
In the Report, on the menu bar go to View...Sorting and Grouping. In the Fields/Expression box, select the field Catagory. In the Group Properties box, set the Group Header to Yes. That will add the group header to your Report. Put your Catagory textbox in the header and the Contacts textbox in the Detail section.
This should get you very close.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top