C
croy
I have nested tables:
tbl1
|_____tbl2
|____tbl3
They are linked by typical autonumber key fields.
On a subform that draws from a query based on tbl1, I would
like to use DCount to count the number of related records in
tbl3. But I can't seem to get the syntax right.
Here's what I've got at the moment (that doesn't work):
=IIf(IsNull([tbl1Id]),"",DCount("tbl2Id","tbl2","tbl1Id=" _
& [txttbl1Id] And "tbl3.tbl2Id =" & tbl2Id))
Is this even possible?
If so, can I persuade any of you to offer better syntax?
tbl1
|_____tbl2
|____tbl3
They are linked by typical autonumber key fields.
On a subform that draws from a query based on tbl1, I would
like to use DCount to count the number of related records in
tbl3. But I can't seem to get the syntax right.
Here's what I've got at the moment (that doesn't work):
=IIf(IsNull([tbl1Id]),"",DCount("tbl2Id","tbl2","tbl1Id=" _
& [txttbl1Id] And "tbl3.tbl2Id =" & tbl2Id))
Is this even possible?
If so, can I persuade any of you to offer better syntax?