ddinisco Posted November 15, 2017 Posted November 15, 2017 This is pretty a simple request that does not seem to work. I have two tables Parent and Child. I want the Parent record (of which there is only) to display the number of Child records in each parent set. In the Child table I have field 'k one' (a calc with a value of 1). In the Parent I have a calc field Count(Child::k one). No matter what I do the value is always 1 on all of the parent records, but it should read 25, 65, 44, etc depending on the number of child related records. What am I missing? Thanks in advance, David
doughemi Posted November 16, 2017 Posted November 16, 2017 First place to check is to make sure the calculation is unstored (in the field definition dialog, click options, then Storage options, then check the "Do not store..." checkbox.
ddinisco Posted November 16, 2017 Author Posted November 16, 2017 Yes it is unstored. The relationship works for other uses, just not for the Count function. This is so simple and also very confusing. This is the calc: Count ( Tracks::k one )
bcooney Posted November 16, 2017 Posted November 16, 2017 To me, there are better ways to count child records: 1. create a summary field in the child table, count_of_records = count of primary key. Display that field on the parent form. 2. create a count (relationship_from_parent_to_child::child_primary_key) in the parent table. 3. Use SQL. Really no need for a dedicated "k one" field in the child.
ddinisco Posted November 16, 2017 Author Posted November 16, 2017 I also tried option1. The calculation in the child table is correct, but when I display that in the parent table it is 0. It is almost like it is totally ignoring the relationship, but the relationship is simple connection of two number fields that DO match. Just for reference I tried approach 1 & 2 in a new solution and it worked fine.
ddinisco Posted November 16, 2017 Author Posted November 16, 2017 Just figured it out. I had two fields named the same, but one had an underscore. Thanks for the input though.
Recommended Posts
This topic is 2575 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now