Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 21st, 2003, 04:17 PM
dwc dwc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 7 dwc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 20 sec
Reputation Power: 0
Help with Calculations in Report

I have a db that tracks citrus orders. In the customer orders form the clerk enters a citrus type, box size (full or half), and a quantity. The unit price is looked up from the products table, which contains separate prices for full and half box sizes.

I‘ve created a report that shows the products, sizes, and quantities for a given date. The report (based on a query that sums the quantities) shows the products (grouped by product name), box size, and quantity like this (formatting aside):

Product Box-size Quantity (in product name header)
Navel full 4 (in detail section)
Navel half 1 (in detail section)

Product Box-size Quantity
Grapefruit half 1

I want to multiply the half-box quantities by 0.5 and add them to the full-box quantities to get an overall total to show in the product name footer. In other words, the report would look like:

Product Box-size Quantity
Navel full 4
Navel half 1

Navel Total: 4.5

Product Box-size Quantity
Grapefruit half 1

Grapefruit Total: 0.5

I just can’t pull it off. I’ve put a textbox in the detail section ([newquantity]) that multiplies the quantity by 0.5 if the size is half but I can’t sum the values. A calculated textbox in the footer (eg. =sum([newquantity]) prompts me for a parameter input because some products don’t have full or half quantities. I’ve also tried putting code in the detail_format section that looks at the quantity, assigns a value of quantity*0.5 (if half), and adding it to the full quantities but no go. Queries have been fruitless because I can’t figure out how to multiply half box quantities by 0.5 and put them in the same column with full box quantities to be summed. An updateable query would work if I could modify the quantity with recordset operations without touching the actual values but is there such an animal?

One very frustrated Access user breathlessly hoping for a solution.

Reply With Quote
  #2  
Old November 21st, 2003, 07:26 PM
dwc dwc is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 7 dwc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 20 sec
Reputation Power: 0
Solved! I used an Iif function in an expression in a query that allowed me to multiply half-box quantities and add them to full-box quantities to get a new field called total. This became the record source for the report and I used a calculated control (=sum([total]) to sum the quantities.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Help with Calculations in Report


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway