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

obtaining sum values in an order form

Status
Not open for further replies.

neerajam

Technical User
Mar 4, 2002
23
0
0
US
I have been trying this out for some time before I gave up and called for help. I have the following fields:
1. baseprice
2. coverprice
3. diskettepocketcost
4. hbcost (hb is hard bind or something to that effect)
5. quantity

total price = (base price + cover + diskette + hbcost)*quantity

I do not have problem when all 4 items are required and the sum total is ok. However, when only the base is ordered and I have the base price only, then the total field does not show the value which should be baseprice * quantity.

Any reason why I am running into this problem.

Thanks.
 
Hi!

Make sure all of the prices default to 0 instead of Null. Just put a 0 in the default line of the property sheet for the field or for the text boxes on the form.

hth
Jeff Bridgham
bridgham@purdue.edu
 
As a alternative, you could use the Nz function in your query. I don't know that one way is any better than the other; a matter of preference probably.

Ann
 
I put in the defalut value of 0 in the table for all the cost fields. Yet I do not get a figure in the total field.
I tried doing the same on the form field property and yet the same result. I wonder what else could be happening. Please let me know. I realize it is a very simple problem and yet it has turned out to be a headache. Thanks.
 
Try this in your query:

TotalPrice: = (Nz([base price],0) + Nz([cover],0) + Nz([diskette],0) + Nz([hbcost],0))* [quantity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top