Calculations not showing on report...

  • Thread starter Newf via AccessMonster.com
  • Start date
N

Newf via AccessMonster.com

I have a text box on my report to show the final calculation. The user enters
a few numbers on the form. I have it setup so when the report is opened thses
run.

Basically the user enters the RRSP and I need to find out the tax rate. If
RRSP <> 0 then tax rate = 0 if not Fed Tax = .10. This all is calc by using
the Total on the report - Total is gotten by adding 2 fields that is done by
the Control Source) - rpt_txt_Totals. Can I actually take the values on a
Report to use to in Calculations?? Anyways here is what I have done and its
showing blank.

Private Sub Report_Open(Cancel As Integer)

Dim txt_RRSP As Integer
Dim rpt_txt_Totals As Integer
Dim rpt_txt_Fed_Tax As Integer

rpt_txt_Totals = rTotals
txt_RRSP = fRRSP


If fRRSP <> 0 Then
rpt_txt_Fed_Tax = rTotals * 0.1
Else
rpt_txt_Fed_Tax = 0
End If
End Sub


Thanks in advance
 
J

Jeff Boyce

Where does "rTotals" come from?

Where does "fRRSP" come from?

How do they "get" to the report?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
N

Newf via AccessMonster.com

Jeff:
Thanks for the reply.

First I should of asked, can I take a field from a report after and use that
in a calculation??

rTotals is the total of 2 fields that the user enters on the form. Its a a
field on the report.
fRRSP is a field on form that the user will enter in. If its not entered the
value should be 0.

The rTotals is calculated in the Control Source - =[frm_txt_CFSA_Arrears] +
[frm_txt_Arrears]

Hope this helps to help moi!

Thanks

Jeff said:
Where does "rTotals" come from?

Where does "fRRSP" come from?

How do they "get" to the report?

Regards

Jeff Boyce
Microsoft Office/Access MVP
I have a text box on my report to show the final calculation. The user
enters
[quoted text clipped - 29 lines]
Thanks in advance
 
J

Jeff Boyce

I'm still a little unclear.

The code you offered appears to use some variables, but I can't tell where
they come from.

Reports can have calculated values embedded in them, but these are not
"saved". Rather, each time the report runs, the calculations take place.

Ditto for forms (you can add in calculated values) ... however, a form can
also have controls that are "bound" to data fields in tables. Whether or
not a value appears to be "saved in a form" depends on whether it was
actually saved in the underlying table.

Tables store data.

Forms display data.

Reports display (for print) data.

Is this how you are trying to use these?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Newf via AccessMonster.com said:
Jeff:
Thanks for the reply.

First I should of asked, can I take a field from a report after and use
that
in a calculation??

rTotals is the total of 2 fields that the user enters on the form. Its a a
field on the report.
fRRSP is a field on form that the user will enter in. If its not entered
the
value should be 0.

The rTotals is calculated in the Control Source - =[frm_txt_CFSA_Arrears]
+
[frm_txt_Arrears]

Hope this helps to help moi!

Thanks

Jeff said:
Where does "rTotals" come from?

Where does "fRRSP" come from?

How do they "get" to the report?

Regards

Jeff Boyce
Microsoft Office/Access MVP
I have a text box on my report to show the final calculation. The user
enters
[quoted text clipped - 29 lines]
Thanks in advance

--
Newf
~Everyone needs a NEWFIE as a friend~

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top