I think you expression in the action that sets the values of column number in the grandparent table could be something like
COUNT(SELECT(Grand Child Table [Grand Child table Key column], IN([Key column of Parent Table],[Related Parents column in the Grandparent Table] )))
Edit: This action can invoke on each save of the parent form but will change the count only based on number of grand child records. So if there is no addition to the grand child records, the action will simply write the same number again in the field. So you need not have any condition to invoke the action on the parent table.
May we know where do you want to write this? Meaning which table ( grand parent , same table?) and which column - real VC etc.
Could you elaborate a bit in more detail?
This expression is going to be written in my Action;
Type: set the values of some columns in this row
Inside of, Only if this condition is true
Which is going to be attached it to a Form's Event Action to trigger when the save button is clicked.
But I DO NOT want it to +1 every time the "save" button is clicked,but only when a new grandchild's record has been added and the "save" button is clicked.
So far I've;
1) created an action set the values of some columns in this row on Grandparent table.
2) created an action execute an action on a set of rows on my Parent table (so I can put it inside my Event Action)
3) The column I want to set is just a real column, type number, named [number]
Thank you, could you add why you cannot use action in step 1 only as an event action?
Is the form on grand parent table?
Like this;
I think you expression in the action that sets the values of column number in the grandparent table could be something like
COUNT(SELECT(Grand Child Table [Grand Child table Key column], IN([Key column of Parent Table],[Related Parents column in the Grandparent Table] )))
Edit: This action can invoke on each save of the parent form but will change the count only based on number of grand child records. So if there is no addition to the grand child records, the action will simply write the same number again in the field. So you need not have any condition to invoke the action on the parent table.
It gives me a 0...
1)ใCreated an Action: Count number
ใFor a record of this table: Grandparent
ใDo this: set the values of some columns in this row
ใSet these columns: number
ใCOUNT(
ใSELECT(
ใGrandchild [id],
ใIN([id],[Related Parents] )
ใ)
ใ)
2) Created an Action:
ใFor a record of this table: Parent
ใDo this: execute an action on a set of rows
ใReferenced Table: Grandparent
ใReferenced Rows: LIST(Grandparent_id)
ใReferenced Action: Count number
3) Put it in Event Actions of Form
I think I made it work by;
COUNT(
ใSELECT(
ใGrandchild [id],
ใIN([Parent_id],[Related Parents] )
ใ)
ใ)
As always, thank you very much for helping me!
User | Count |
---|---|
43 | |
26 | |
23 | |
14 | |
11 |