Hello,
It took some effort but do have an answer.
First note the posted .odb was not in proper format. Had to break it down and create a split DB from the internals. then copy the form over.
Took a while just to figure out what you were doing. Think there may be further problems with the design but put the effort into solving your problem.
Here is your SQL for the grid control:
Please note the links from table to table. IT
in “SOLD” to “ITEMS” is OK. But IT
from “ITEMS” to CU
in “CUSTOMER” makes no sense at all. In fact you are missing an entire table here for linking:
By adding in the “INVOICE” table and correcting the links, the calculations are correct. You were using the incorrect discounts with the incorrect linking.