I am fairly sure you can get away with DCount, for example, this works for me:
But I would still recommend not doing this and just getting your counts from a query.
문제
Parent (licenseID, countChilds)
Child (hostID, licenseID)
Trying to write an after insert/update/delete trigger that fires when adding a record to the child table. It needs to count child records linked to the parent and then insert this value into the parent.
But I keep getting the SQL statement is not valid.
So far I have this:
I am using MS Access 2010.
해결책
I am fairly sure you can get away with DCount, for example, this works for me:
But I would still recommend not doing this and just getting your counts from a query.
다른 팁
This seems to work, at least for After Insert
:
The After Update
Data Macro would be a bit more involved because it might have to update two [License] records (one for [Host].[licenseID] and another for [Old].[licenseID]), or perhaps none (if [Host].[licenseID] did not change).