calculated control

B

Barb

Hi Everyone

I have a query that sums my totals for 2004 and 2005
Year,Total
I display in on continious form, so 2005 shows rigth under 2004.
I'd like to have a control that shows difference in totals between 2005 and
2004, and another one showing that difference as %.

How should I go about that?

Barb
 
K

KARL DEWEY

Open the form in design view. Copy the textbox that displays your 2004 and
paste where you want the Difference. Edit the label. Click on the menu VIEW
- Properties. Click on the 2005 textbox and copy the information shown on
Control Source line. Click on the Difference textbox and edit the Control
Source line to look something like this --
=Sum([Your2004Data]) - Sum([Your2005Data])
This subtracts the 2005 from the 2004. Reverse it if you want to subtract
the 2004 from the 2005.
For the percent do the above copying the Difference textbox and pasting for
Percent. Edit the Control source to derive the percent.
=(Sum([Your2004Data]) - Sum([Your2005Data]))/Sum([Your2005Data])*100
 
B

Barb

Hi Karl
Can't do that. It's a continous form. My 2004 total and 2005 Total is the
same control called "txtTotal". I was thinking about DSum but I'm not sure
how it works. Then I would have two controls calculating DSum on 2004 and
other on 2005, but I can't get it to work.

sorry, I'm running in circles here

Barb

KARL DEWEY said:
Open the form in design view. Copy the textbox that displays your 2004 and
paste where you want the Difference. Edit the label. Click on the menu VIEW
- Properties. Click on the 2005 textbox and copy the information shown on
Control Source line. Click on the Difference textbox and edit the Control
Source line to look something like this --
=Sum([Your2004Data]) - Sum([Your2005Data])
This subtracts the 2005 from the 2004. Reverse it if you want to subtract
the 2004 from the 2005.
For the percent do the above copying the Difference textbox and pasting for
Percent. Edit the Control source to derive the percent.
=(Sum([Your2004Data]) - Sum([Your2005Data]))/Sum([Your2005Data])*100

Barb said:
Hi Everyone

I have a query that sums my totals for 2004 and 2005
Year,Total
I display in on continious form, so 2005 shows rigth under 2004.
I'd like to have a control that shows difference in totals between 2005 and
2004, and another one showing that difference as %.

How should I go about that?

Barb
 
Top