potts
Registered User.
- Local time
- Today, 12:47
- Joined
- Jul 24, 2002
- Messages
- 87
Got two problems.
First.
I have an unbound text box that I want to calculate the sum of values in a subform. I have entered the expression as follows:
=Sum([SubTotal])
[SubTotal] being the field to be totaled. However, the result keeps coming up #Name. Anyone know how to sort this? I might mention that [SubTotal] is also a calculated field.
Second.
On another form I have an unbound text box that counts the number of entries in a subform
=Count([CustomerID])
CustomerID is half of the Primary Field, the other half being ProgramID.
The count works fine. However, I then want another unbound textbox to divide cost by the count. [Cost] is a calculated and unbound field. So I have tried:
=[Cost]/[Count]
[Cost] and [Count] being the two fields the calculation is to be performed on. The problem is that:
1. I get the wrong value returned ... e.g. £40/2people = £2.2222
2. If the count is changed, i.e. a record added or deleted, the change is not reflected in the latter calculation.
any ideas on how I might sort this mess out?
First.
I have an unbound text box that I want to calculate the sum of values in a subform. I have entered the expression as follows:
=Sum([SubTotal])
[SubTotal] being the field to be totaled. However, the result keeps coming up #Name. Anyone know how to sort this? I might mention that [SubTotal] is also a calculated field.
Second.
On another form I have an unbound text box that counts the number of entries in a subform
=Count([CustomerID])
CustomerID is half of the Primary Field, the other half being ProgramID.
The count works fine. However, I then want another unbound textbox to divide cost by the count. [Cost] is a calculated and unbound field. So I have tried:
=[Cost]/[Count]
[Cost] and [Count] being the two fields the calculation is to be performed on. The problem is that:
1. I get the wrong value returned ... e.g. £40/2people = £2.2222
2. If the count is changed, i.e. a record added or deleted, the change is not reflected in the latter calculation.
any ideas on how I might sort this mess out?