I have a main form called Quotes, and a subform called QuoteDetails (in datasheet view). And each with their respective tables. FYI That's a "quote" as in pricing for an estimate to a customer.
The main form has a textbox called txtTotalPrice, it's control source =DSum( appropriate fields in the quote details )
I would like my txtTotalPrice to reflect the total price as records are added/changed in the subform. in the subform's AfterUpdate event I placed the codeAnd this does update the txtTotalPrice.Code:Me.Parent!txtTotalPrice.Requery
My Problem is that when txtTotalPrice.requery is executed it actually just requeries the whole parent form (from what I can tell) and in doing so my subform current record jumps back to the first record. This sucks. Imagine working in a spreadsheet and everytime you hit enter it jumps back to the top of the sheet.
How should I keep my txtTotalPrice updated in my parent form while not loosing my spot in the subform?
PS:
Unfortunately simply using a Total's row at the bottom of the subform's datasheet wont be satisfactory for my situation.
EDIT (I figured it out):
It dawned on me that my approach was wrong. I've had this problem else where before. The solution was to add txtPriceTotal text box in the form footer in the subform with a control source =Sum(...), not DSum. Then in the main form change the control source from the DSum function to just reference the price total text box in the subform. Now requering controls is no longer necessary and all works as it should.