In message <40***********************@news.optusnet.com.au> , Tom Keane
<la********@optusnet.com.au> writes
Okay, so the deal is, I am doing a mail merge document in order to print
invoices. The field I get the amount of money is "invAmount". What I would
like to do is be able to manipulate this number to get different percentages
of that total amount on my document. For example, display 10% of that
amount. I am not too familiar with using field codes and have only used them
a couple of times in the past. I'm currently doing this with Word 2000.
If the document you are creating is an invoice then I would tackle the
problem slightly differently. It is very important that the database
stores exactly what is on the invoice, so that an auditor can check it
later.
I would record the item price and tax rate in the table and build a
query to be used for reporting. You have to record precisely what rate
of tax was used at the time the invoice was raised, so you can't just
store one central tax rate because it's possible that the rate would
change, which would invalidate all of the previous invoice data. Talk to
an auditor and ask them what they want in the database.
In the query you would need three fields: for the net, gross and tax
amounts. So if you store [NetAmt] as the value before tax and [TaxRate]
as the proportion to be added as tax then the third field is [GrossAmt]
and in the query you would have a calculated field
GrossAmt: [Netamt] * [TaxRate]
The mailmerge would be run using the query rather than the underlying
table as the data source, and all of the tax calculations get done in
Access and not in Word.
You might also want to set up another table just to hold the totals of
the invoices, for future analysis. Think of it as the first step towards
a data warehouse.
--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.