By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,497 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

calculations and formatting issues

imrosie
100+
P: 222
Hello All,

I'm having trouble calculating my sales tax, adding freight charges and sale tax to the 'Order Total'. Help someone......

I have 2 subforms on a Main form....

In subform 1(called Order Details Subform) , I calculate 'TheOrderDetailTotal (from unitprice X quantity It calculates successfully and displays on the Main form in a control labeled 'Order Subtotal'.

Code:
=Forms![Add an Order and Details]![Order Details Subform].Form!TheOrderDetailTotal


The problem comes in when I attempt to add calculate sales tax, and then add that sales tax and freight charge to the 'Order Total' control. I can't seem to get it formatted properly to make it sum up together. Both controls 'FreightCharge' and 'SaleTaxAlone' are subform 2 (called Order Ship Details Subform).

The sales tax rate (by default is 6%) so the control is 6% until someone adds a different rate, this control is called:'ANewSalesTax'.

I'm just having trouble getting the 'SalesTaxAlone control working and then adding that amount along with Freight Charges to the 'Order Total' control. I've scrambled parenthesis everywhere,,,but here's the latest rendition of what's not working:


'SalesTaxAlone':
Expand|Select|Wrap|Line Numbers
  1. =Forms![Add an Order and Details]![Order Details Subform].Form!AnOrderDetailTotal*Forms![Add an Order and Details]![Order Ship Details Subform].Form!ANewSalesTax
'TheOrderTotal':
Expand|Select|Wrap|Line Numbers
  1. =(Sum(Forms![Add an Order and Details]!TheOrderDetailTotal)+(Forms![Add an Order and Details]![Order Ship Details Subform].Form!FreightCharge)+(Forms![Add an Order and Details]![Order Ship Details Subform].Form!SalesTaxAlone))
thanks for your help...
Rosie
Sep 11 '07 #1
Share this Question
Share on Google+
2 Replies


Scott Price
Expert 100+
P: 1,384
Hello All,

I'm having trouble calculating my sales tax, adding freight charges and sale tax to the 'Order Total'. Help someone......

I have 2 subforms on a Main form....

In subform 1(called Order Details Subform) , I calculate 'TheOrderDetailTotal (from unitprice X quantity It calculates successfully and displays on the Main form in a control labeled 'Order Subtotal'.

Code:
=Forms![Add an Order and Details]![Order Details Subform].Form!TheOrderDetailTotal


The problem comes in when I attempt to add calculate sales tax, and then add that sales tax and freight charge to the 'Order Total' control. I can't seem to get it formatted properly to make it sum up together. Both controls 'FreightCharge' and 'SaleTaxAlone' are subform 2 (called Order Ship Details Subform).

The sales tax rate (by default is 6%) so the control is 6% until someone adds a different rate, this control is called:'ANewSalesTax'.

I'm just having trouble getting the 'SalesTaxAlone control working and then adding that amount along with Freight Charges to the 'Order Total' control. I've scrambled parenthesis everywhere,,,but here's the latest rendition of what's not working:


'SalesTaxAlone':
Expand|Select|Wrap|Line Numbers
  1. =Forms![Add an Order and Details]![Order Details Subform].Form!AnOrderDetailTotal*Forms![Add an Order and Details]![Order Ship Details Subform].Form!ANewSalesTax
'TheOrderTotal':
Expand|Select|Wrap|Line Numbers
  1. =(Sum(Forms![Add an Order and Details]!TheOrderDetailTotal)+(Forms![Add an Order and Details]![Order Ship Details Subform].Form!FreightCharge)+(Forms![Add an Order and Details]![Order Ship Details Subform].Form!SalesTaxAlone))
thanks for your help...
Rosie
Hi Rosie,

Check your spelling very carefully... I notice that in your first line you refer to the control TheOrderDetailTotal on your subform [Add an Order and Details] while later on you refer to AnOrderDetailTotal on the same subform.

Regards,
Scott
Sep 19 '07 #2

NeoPa
Expert Mod 15k+
P: 31,186
Rosie,

Let's start by uncomplicating matters where we can.
I suggest we start with the [SalesTaxAlone] control on [Order Ship Details Subform] form.
We need to create a formula consisting of two values ([AnOrderDetailTotal] & [ANewSalesTax]) which are multiplied together. The first thing we need to do is to set [SalesTaxAlone] to each of the two values separately (to ensure that our method of reference is working as expected). When the first is working as intended, change it to the second and work on that until it too is working.

Post back when this is fully working (You can include the actual code used for both references).
If you have difficulty getting either of these to work then post back in that case too, explaining your situation.
Sep 19 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.