Subject: Urgent help about sending customized summary
Posted By: Elain Post Date: 12/8/2005 10:51:38 AM
Hi, could anyone teach me how to do this? I need some urgent help here! Experts please help! Thanks in advance!

Here is the result of a query I have:

Person          Email     Product Amount Category
A        A@hotmail.com    Apple    10      Fruit
A        A@hotmail.com    Orange   20      Fruit
A        A@hotmail.com    Pen      30      Office
B        B@hotmail.com    Apple    15      Fruit
B        B@hotmail.com    Orange   25      Fruit
B        B@hotmail.com    Pen      35      Office
C        C@hotmail.com    Apple    18      Fruit
C        C@hotmail.com    Orange   28      Fruit
C        C@hotmail.com    Pen      38      Office

What I need to do is the develop a report or other format, in a format like:

Person: A

Category
Fruit Amount Office Amount
Apple   10   Pen 30
Orange  20
Total 30     Total 30



Do this for A,B,and C and send the individual report in via email to them. To me it looks like a mail merge, but I don't know how to manipulate the data and put it into the layout. Also, how to get total for each category in the report?  My real data has a lot of data, about 100 person, and about 60 product that falls into two categories. Is there anyway easy and fast way to do this? Please help! Thank you very much!

--------------------------------------------------------------------------------


Reply By: lbreitenbach Reply Date: 12/8/2005 1:37:36 PM
Elain,
Here is how I have done this type of thing...(if there is an easier way, someone please share.)

For what you have provided you will need to do this for each person:
Create a query for the table and add all the fields.
Add a query field "FruitTotal: IIf (Category = Fruit, Sum(YourTableNameHere!Amount), "0")"

Add a query field "OfficeTotal:IIf (Category = Office, Sum(YourTableNameHere!Amount), "0")"      (my note: if you will always only have one "office" for each person, you will not need this field in the query.

Then when you apply this to a form you can either have a "WhereCondition" on the open event so you can specify a person, or create a query & report like this for each person with the criteria set in the query.

Hope I understood what you are trying and was a help.

Regards,
Laura

The only thing standing between you and your goal is doubt.  Quit doubting yourself and you'll be able to accomplish anything!

Go to topic 37043

Return to index page 420
Return to index page 419
Return to index page 418
Return to index page 417
Return to index page 416
Return to index page 415
Return to index page 414
Return to index page 413
Return to index page 412
Return to index page 411