Creating totals while using two tables

Hello, this might be a very simple question since I can’t find a similar question posted earlier. I’m working on a rather simple report based on two tables (A & B). I retrieve two fields from table A (Case no. & Amount). Table properties are set to GroupTotalFields: Case no., TotalFields: Amount & PrintOnlyIfDetail: Yes. Table B is linked with table A on Case no. Table B is also grouped on Case no. since I’ve to retrieve a Transporter no. from it. Reports works fine until I do not apply any filter on table B. For example, if I can filter by date for a specific period on table A. Report shows correct totals, etc. But as soon as I add another filter on table B, e.g. a transporter no. then the total for amount go crazy. It shows the right records, i.e. for a specific transporter within a specific period (meaning “PrintOnlyIfDetail: Yes” working fine) but the grand total in the footer section shows the total amount for all posts, whether printed or not, within the date filter on table A. I thought that the “PrintOnlyIfDetail: Yes” property should also work for totals but it don’t. Would anyone please help me solve this problem??

The TotalAmount adds up the amount of each record within the selection. You don’t apply a selection on the table where you have defined the GroupTotals, so you’re getting false results. If possible, use a field from the second table for totals, otherwise use a variable which is populated in the OnAfterGetRecord trigger of the second table. See also help on CreateTotals() function. John

Thanks a lot John. Since I’m used to of working in MS Access therefore I assumed the totals should be generated for the output shown. But I was wrong. Now the problem is solved & I learned something usefull. Thanks to you. Kind regards, Tariq