Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Main Form Calculation Not Updating! Brain Hurts!!!

Status
Not open for further replies.

Ludey2

Technical User
Sep 27, 2001
2
US
I am in serious need of help. I have built a hefty database and I have been stuck for ~10 days on one problem. I have a main form with 21 subforms on it. In each subform there is a subtotal calculation(works). On the main form, there is a GRAND total that sums all of the subtotals. Here's the catch: On the first record, "GRAND TOTAL" works to the penny. As I scroll to subsequent records, all the other entered data is visible but the "GRAND TOTAL" field is blank. (Warning: I don't know any "code" - I am just an typical user)

I don't understand why it works on the first record, but not on subsequent?
PLEASE HELP ME - MY BRAIN HURTS AND I HAVE NO RESOURCES TO GO TO!
 
Don't know if this will work but....
Are you advancing to the next record by hitting the record selector button or did you make a button to move to the next record?
If you made a button, try to make the "on click" command of the button do me.grandtotalbox.requery Maybe that will update your main page grandtotal.
If all your sub-pages are changing when you forward the MAIN record but the grand total field doesn't update...maybe that will force it to recalculate.
 
I think the previous answer is on track. Try this in the first subform. If it works, then it'll work for the whole form.

You need to save the information in the main form before you get into the subform. To do this, go into design mode of the first subform and then into properties. Under Events, I would use OnOpen. You'll need to put in a little code (sorry). Click in the OnOpen space and then on the three dots (...). Then select code builder. In the space that comes up, type:

DoCmd.Save acForm

That should do it.

Once the information from the main form is saved, the subforms will be able to use it. As you exit each of the subforms, they will save automatically, so as long as you always start with the same subform, you won't have a problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top