Hi,
Please help me, I'm trying to build a report based on the following table
[CUST TYPE] [PRODUCT CODE][DATE][AMOUNT]
296 P/O 06/31/03 (14.95)
587 M 07/06/03 15.95
772 D/A 06/31/03 22.95
824 P/O 05/28/03 (18.95)
772 M 05/07/03 14.95
I can group the report by CUST TYPE and DATE, but need help using expressions.
I'm trying to do two things:
1) Total AMOUNT by PRODUCT CODE e.g M = $38.90
2) Show the percentage per PRODUCT CODE e.g P/O = 40%
Humvie was kind enough to supply me with the following, although I tried it and cannot get it to work. I tried adding a combo box to my form under [PRODUCT CODE] and using the query below but I could not get it to work. I entered the code exactly as it appears except for using MyTable Name. Can anybody tell me where I went wrong or how to do the above through expressions.
Thanks so much in advance of your help.
Tek-Tips Fan.
Kirtsen
Assuming you have a combo box on your form, this is how you would code your query.
DIM SqlName As String
If Not IsNull(Me![PRODUCT CODE]) Then
SqlName = SELECT SUM(AMOUNT) FROM YourTableName WHERE & " [PRODUCT CODE]= '"
& Me![PRODUCT CODE]& "'
End If
Please help me, I'm trying to build a report based on the following table
[CUST TYPE] [PRODUCT CODE][DATE][AMOUNT]
296 P/O 06/31/03 (14.95)
587 M 07/06/03 15.95
772 D/A 06/31/03 22.95
824 P/O 05/28/03 (18.95)
772 M 05/07/03 14.95
I can group the report by CUST TYPE and DATE, but need help using expressions.
I'm trying to do two things:
1) Total AMOUNT by PRODUCT CODE e.g M = $38.90
2) Show the percentage per PRODUCT CODE e.g P/O = 40%
Humvie was kind enough to supply me with the following, although I tried it and cannot get it to work. I tried adding a combo box to my form under [PRODUCT CODE] and using the query below but I could not get it to work. I entered the code exactly as it appears except for using MyTable Name. Can anybody tell me where I went wrong or how to do the above through expressions.
Thanks so much in advance of your help.
Tek-Tips Fan.
Kirtsen
Assuming you have a combo box on your form, this is how you would code your query.
DIM SqlName As String
If Not IsNull(Me![PRODUCT CODE]) Then
SqlName = SELECT SUM(AMOUNT) FROM YourTableName WHERE & " [PRODUCT CODE]= '"
& Me![PRODUCT CODE]& "'
End If