Show calculation from main form in sub form

  • Thread starter Thread starter tboyce
  • Start date Start date
T

tboyce

I have a field on my main form. I have a calculated sum on my sub form called
DaysLeft which is calculating how many days used so far. I would like to
subtract the figure on the main form from that on the sub form and show the
result back on the sub form. I have used the following formula but it reports
an error

=[Form]![StaffMembers]![Entitlement]-Me![DaysLeft]

StaffMembers being my main form & DaysUsed being the calculation field on
the sub form. There are plenty of examples showing calculations from sub to
main but not the other way round. Can anyone help please
 
I have a field on my main form. I have a calculated sum on my sub form called
DaysLeft which is calculating how many days used so far. I would like to
subtract the figure on the main form from that on the sub form and show the
result back on the sub form. I have used the following formula but it reports
an error

=[Form]![StaffMembers]![Entitlement]-Me![DaysLeft]

StaffMembers being my main form & DaysUsed being the calculation field on
the sub form. There are plenty of examples showing calculations from sub to
main but not the other way round. Can anyone help please

Either use

[Forms]![StaffMembers]![Entitlement] - [DaysLeft]

or

Parent.[Entitlement] - [DaysLeft]

It's Forms! rather than Form!, and you can only use the Me! shortcut in VBA
code.
 
Thank you for that John both of these worked straight away

John W. Vinson said:
I have a field on my main form. I have a calculated sum on my sub form called
DaysLeft which is calculating how many days used so far. I would like to
subtract the figure on the main form from that on the sub form and show the
result back on the sub form. I have used the following formula but it reports
an error

=[Form]![StaffMembers]![Entitlement]-Me![DaysLeft]

StaffMembers being my main form & DaysUsed being the calculation field on
the sub form. There are plenty of examples showing calculations from sub to
main but not the other way round. Can anyone help please

Either use

[Forms]![StaffMembers]![Entitlement] - [DaysLeft]

or

Parent.[Entitlement] - [DaysLeft]

It's Forms! rather than Form!, and you can only use the Me! shortcut in VBA
code.
 
Back
Top