Store subtotals and calculate tax on taxable items

cindygo

New Member
Joined
Nov 30, 2010
Messages
40
I have found an Access Template that fit all requirements with a few exceptions.

Link to template:
http://office.microsoft.com/en-us/templates/goods-template-TC102483123.aspx

Exceptions:
1- Indicate taxable products
2- Store Order Retail Sales Sub Total
3- Store Order Service Sales Sub Total
4- Display Order Retail Sales Sub Total on Order Form
5- Order Retail Service Sales Sub Total on Order Form
6- Calculate tax only on taxable products

What I have done with my comments and questions:
I added a True/False bit named Taxable on the Product table and have updated several line items bit to thre.

I added the Taxable bit to the OrderDetailSubFrom. Now when I select a product the bit is displayed as True/False. Perfect.

I added two new fields in the Orders table named, OrderRetailSales and OrderServiceSales. Both are currency.

I added both new fields from the Orders table to the Orders Form above the SubTotal.
Name txtOrderServiceSales
Control Source OrderServiceSales

Name txtOrderRetailSales
Control Source OrderRetailSales

I created a query named RetailTaxableSales to be used in a macro named CalcRetailSubTotal

SELECT OrderDetails.OrderID, OrderDetails.ExtendedPrice
FROM Products INNER JOIN OrderDetails ON Products.ID = OrderDetails.ProductID;

In the Orders table I created two new macros via Table > Named Macro > Create Named Macro:

Macro -CalcRetailSubTotal
Parameters Name prmOrderID
/* Calculate new Order Retail Sales SubTotal /*
SetLocalVav
Name varOrderRetailSales
Expression = 0
For Each Record in RetailTaxableSales (the query noted above)
Where Condition = [OrderID]=[prmOrderID]
SetLocalVar
Name varOrderRetailSales
Expression = [varOrderRetailSales]+[ExtendedPrice]
SetReturnVar
Name retOrderRetailSales
Expression = [varOrderRetailSales]

Macro –UpdateRetailSalesSubTotal

Parameters Name prmOrderID
/* Calculate new Order Retail Sales Total /*

RunDataMacro
Macro Name Orders.CalcRetailSubTotal
SetLocalVar
Name varOrderRetailSales
Expression = [ReturnVars]![retOrdersRetailSales]

/* Store new Order Retail Sales Total/*
Look Up A Record in SELECT Orders.ID, Orders.OrderRetailSales FROM Orders;
Where Condition = [ID]=[prmOrderID]
If [varOrderRetailSales]<>[OrderRetailSales] Then
Edit Record
Aias
SetField
Name OrderRetailSales
Value = [varOrderRetailSales]


Listed under Objects I updated the macro named Orders with the following submacro

Submacro – UpdateRetailSalesSubTotal

/* Macro used to recalculating and updating Retail Sales SubTotal on Order Form/*
RunDataMacro Orders.CalcRetailSubTotal
Parmeters prmOrdersID = [txtID]
If [ReturnVars]![retOrderRetailSales]<>[txtOrderRetailSales] then
End If
End Submacro


I have spent a lot of time just trying to get the OrderRetailSales to display in the form when I select a product or have it stamp to the database but none of the above does that.

I think once I have that I could move on and calculate the tax on that field.

Does someone explain what I am doing wrong and guide me to a solution. Thanks, cindygo
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,224,521
Messages
6,179,277
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top