Subtraction in reports (1 Viewer)

moleary

Senior Member
Local time
Today, 14:36
Joined
Feb 9, 2001
Messages
58
How can I do subtraction in my report, I have two columns one for requested hours and another for approved hours and I have totaled these columns now I would like to see the difference in hours?
 

Coolguy

New member
Local time
Today, 14:36
Joined
Mar 8, 2001
Messages
6
try thhis
=[requestedhours]-[approvedhours] on a text box
 

moleary

Senior Member
Local time
Today, 14:36
Joined
Feb 9, 2001
Messages
58
I did that and it gave me #error, I put a text box and with the expression builder I put approved hours-requested hours?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:36
Joined
Feb 19, 2002
Messages
43,328
Check the control name of the textbox. It cannot be the same as the name of one of the columns used in the form's recordsource. When you use a wizard to build a form, it usually names the controls with the same name as the recordsource column that is bound to them. If you changed one of these wizard built controls to do the calculation, you'll need to change the control name.

Normally having the control name the same as the recordsource column name it is bound to is not a problem. However, if you do any calculations, Access has no way of knowing whether you are refering to the control or the recordsource column and that generates the #error.
 

Users who are viewing this thread

Top Bottom