What data type is Number of Hours Leave? It should be of type number, not text. this is probably why it is greyed out.
There are two ways to compute the total of values shown in an unfiltered portal:
In the parent table, define a calculation field as:
Sum ( PortalTableOccurrence::Number of Hours Leave )
In the portal table, define a summary field that computes the total of Number of Hours Leave. (I'd guess Number of Hours Leave is text and that would explain it being "greyed out".)
The calculation field with Sum will update more smoothly when totaling a value in an unfiltered portal where the users edits fields that affect the total being computed.
The summary field will work with filtered portals and can compute totals faster in some circumstances when large numbers of records are being totaled. A script trigger can run a script to refresh the window when you use the summary field and need the total to update each time you edit a field that's part of the total.
Thanks for that, You were right... it was text!! doh!!
Now for the silly question....in your calculation:
Sum(PortalTableOccurence::Number of hours leave)
Where do you get the information PortalTableOccurence?
Do I just put a number here or can it automatically just count the amount of occurences there are?
Where do you get the information PortalTableOccurence
I try to be very specific with my examples. Table occurrences are the "boxes" found in Manage | Database | Relationships.
In portal setup, there's a drop down titled "show related records from". You'll see the same text listed in the bottom left corner of the portal when in layout mode. This text matches the name of one of the table occurrences in your database. You need to use that name, whatever it is, in place of "portal table occurrence". The key here is to make sure to specify the same occurrence as your portal to make sure that you are instructing FileMaker to use the same relationship.
If interested in learning more about table occurrences and how they control the function of your database, see this tutorial: Tutorial: What are Table Occurrences?
Brain dead I'm afraid!!! Thanks for the explaination, it worked perfectly.
Thanks for your help,