Forms.recalc behavior

  • Thread starter Thread starter kpick4 via AccessMonster.com
  • Start date Start date
K

kpick4 via AccessMonster.com

Access 2007 question. I have no experience with previous versions of Access.
I have an order form with a subform for the order details. The user wants
the order totals to refresh after each relevant control is updated in the
subform. Example: the user changes the quantity of an item so the total
amount of the order should update immediately. Forms.recalc does this
perfectly, but it moves the focus to the first record in the subform. I need
it to return to the same record that called the recalc, but in the next
control. I am NOT a VBA programmer.
 
If the controlsource of a textbox in the subform's footer is set to:

=Sum([Mycontrol])

it should recalculate immediately. If the subform is a datasheet, use a
textbox on the mainform to refer to it:

=[Forms]![NameOfMyForm]![NameOfMySubform].Form![TextBoxname]
 
kpick4 said:
Access 2007 question. I have no experience with previous versions of Access.
I have an order form with a subform for the order details. The user wants
the order totals to refresh after each relevant control is updated in the
subform. Example: the user changes the quantity of an item so the total
amount of the order should update immediately. Forms.recalc does this
perfectly, but it moves the focus to the first record in the subform. I need
it to return to the same record that called the recalc, but in the next
control. I am NOT a VBA programmer.


A total can not be recalculated until the edited record is
saved. When the record is saved, the =Sum(...) text box
should update automatically. I think all you need is

Me.Dirty = False

and if that is not sufficient for some reason, add the line

Me.[total text box].Requery
 
Back
Top