Expression Field (1 Viewer)

sandhurstUK

Must change my user name
Local time
Today, 19:51
Joined
Feb 15, 2002
Messages
42
I have a table which contains a field called IU value which contains information about outstanding work for a given site. The field is a numeric value ranging from 1 to 20.
I run a qry from the table which display the data correctly in a subform.
What I want to display is a stand alone field on the main form which shows the sum of all the IU values and divides it by a number, to turn the value into man days.
For example the expression should be along the lines of:
sum[IU Value]/414
Every time I go back from design view to form view, the field shows either #Name# or #Error# depending on how I write the expression. I cannot seem to crack the formula for the expression and would appreciate any help forthcoming.
Many thanks
 

Jonathan Kok

Registered User.
Local time
Today, 14:51
Joined
Jan 27, 2000
Messages
116
On the subform, create a field on the form footer that calculates the sum of the IU Value, ie, set the control source to "=sum([IU Value]). Name it txtSumIUValue, or something like that.

On the main form, create another field and set its control source to '=SubFormName!txtSumIUValue', that'll get it onto your main form. It SHOULD update automatically as you add/remove entries from the subform, however, there is a delay. You might even be able to set the source to something like '=SubFormName!txtSumIUValue / 414' or something like that, but don't quote me on that.

Good luck!
 

sandhurstUK

Must change my user name
Local time
Today, 19:51
Joined
Feb 15, 2002
Messages
42
Thanks Jon,

Slight adjustment needed to the code and your suggestion worked fine.
 

Users who are viewing this thread

Top Bottom