Unanswered: Totals calculated too slowly for label on main form
I have another question. The situation is kinda difficult to explain so please bare with me...
I have a form and a subform in MS Access 2000. On the footer of the subform I calculate two sums. Based on the difference between the two sums, a label should be visible. The problem is that the calculation takes apparantly too long. This results in incorrect showing of the result.
On the main form i have a number indicating the minimum stock.
On the sub form I calculate the total amount in stock, and the total amount ordered but not delivered. If the sum of these two is lower than the minimum stock, I want to show a label saying so.
However, in the routine that determines the visibility, the two totals are still null, so they're always below the minimum stock, and the label is always shown.
After a lot of debugging and testing, I seem to find out that the totals are only filled in AFTER the "on current" event of the main form...
I will include an attachment. This is a db based on a Microsoft Template.
On opening go to the Enter/View Products form. First open the form as is. Look at the mention of "Reorder !!!", in comparison to the totals in the boxes above... this is wrong!!!
Now put a break in the VB code of the form, in the Sub Form_Current. If you now step through the code, the label is displayed correctly...