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

Reports - Calculated fields

Status
Not open for further replies.

eveCalypso

Programmer
Apr 29, 2003
134
GB
Hello All,

I am finally getting somewhere with my reports, however, I do have another problem (small I think).

I am reporting off a transactions table and are displaying the results.
I have a table called CurrVatPerc which holds the current VAT(tax) percentage applied to goods.

I would like the following:

.... Amount VAT (Calculated from table) TOTAL

So, in the VAT field, I would like to be able to reference my getVat procedure in my general functions module, something like:
=genProc.getVat * [amountFromDB]

Firstly, I do not know how to do this - I do not have access to the texbox's control source property in the Report's Open event (?).
In theory I could probably include the Vat Table in my Stored Procedure and calculate it from there, but my stored proc is pretty complex as it is already (GROUPS etc). Wondered if I could do this via code instead.

Needless to say, the Total needs to be =[AmountFromDB]+[txtVat] - which doesn't work either.
I reckon I have a syntax problem!

Regards,
EvE
 
You can open a report in design view first, setting control sources of textboxes, then opening it. It is slow and does not look great because sometimes it flickers from design view to open view but I think this will do your job.
 
Why can't you join the tax tax to the transaction table and then returned the tax amount along the amount to the report?
 
Hello All,

Thank you for the replies.
cmmrfds, I am not sure I understand you correctly. If you ask why I do not select the tax value in my query as well as the resulting amounts etc, well, that is what I am now doing - as a solution.

If you meant why don't I add the taxed amount in my table - well as you probably know - bad DB design.

Thank you for all your feedback!!!
Regards,
EvE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top