While running some simple code to Total a few columns, unexpectedly some of the summary records did not have a total, just a blank cell or space. I doubled the code in my procedure, or duplicated the code so that fields would be totaled twice, and the totals appeared as expected. Has anyone else had a problem with fleeting totals?
From time to time I have run into this problem where a summary record does not display the total after running the Total statement. I can illustrate this problem. Perhaps there is someone out there who can download the zipped file and see the problem that I am seeing. More often than not, I am the cause of a problem, but so far I have not figured out what I am doing wrong with this one. Thank you in advance for any help. File: https://www.dropbox.com/s/9o05clzhuyqzrrs/UnitMixTemp%20copy.pandb.zip?dl=0
I downloaded your database and ran the procedure that had groupup and total statements in it. It generated the correct summary records every time as you can see in the screenshot below. Are there any extra steps necessary to reproduce this problem?
Jim, the problem is the missing number 60 in the first summary in the field Units.
James, I noticed all your number fields are set up as floating numbers. When I change the non-decimal fields to integer, the summaries seem to work and show all sums.
Thanks guys for reviewing this. This is important to since we perform calculations on the totals on Summary Level 1. My usual workaround is to run the Total statement twice on each totaled column. That seems to clear things up. It would be nice not to have to do that.
Aha, James put the description of the problem into the name of the procedure! That’s a new one, I didn’t notice it there.
That didn’t work for me - there was just a different summary record that had a missing value.
There seems to be some kind of corruption in this database. I was able to duplicate this problem with a very minimal program.
startdatabasechange "ALLRECORDS" field UnitType groupup field Units Total
(Note: I added the
startdatabasechange line so that I could Undo after running the code, so I could quickly try it over and over. It’s not needed though.)
I made a brand new database with the same fields by hand, and typed in the data (only the two fields in question). It worked without a hitch. So I think there is something wrong with the structure of your database. I would suggest exporting the database to a text file, then create a new database by importing the text. If you have a lot of procedures and/or forms you can use the View Organizer to drag them over relatively quickly.
I don’t think there is anything wrong with the structure of the database as this can be replicated in a brand new database. Still having some issues here with random missing totals in Summary Records. I have had success by following these two rules: Rule #1 as suggested by KJM. Make sure that the summary record fields are non-decimal integer fields. Rule #2 is to never perform calculations on summary records. First delete all detail data, and then perform any necessary calculations on what where summary records. I have floating point fields with two digits to the right of the decimal point that depend on calculations of the summary totals. I can get the desired results by following the above two rules.
If you can tell me the steps that will replicate this problem in a brand new database, I’m all ears. I was not able to replicate the problem in a new database – even when used exported data from the database you sent me to populate a new database.