>>I have two tables related together and want to be able to count the number of associated child records whenever I move the pointer in the parent table.
>>
>>How do I do this?
>
>Bruce, depending on how you're moving your pointer you could use the following. I'm guessing that you're moving the pointer in a grid and have the count showing in a text box or label.
>SELECT Count(*) FROM Child ;
> WHERE Child.ForeignKey = Parent.PrimaryKey ;
> INTO ARRAY laCount
>You can use the laCount[1] like a variable by just using laCount.
This would work as long, as you don't change parent/child tables (unbuffered).
If it's not broken, fix it until it is.
My Blog