Automatically updating data in a text box

  • Thread starter Thread starter Lisa
  • Start date Start date
L

Lisa

I have a tabbed form named Orders. Tab 1 has a top area based on
'Orders Qry'. There is a subform at the bottom based on 'Order Details
Extended Qry'.
In the subform a product is selected from a drop-down list, a unit
price is entered automatically, a quantity is choses, a discount % is
chosen and the extended price is then calculated automatically.
To this point all works well.
On the top part of Tab 1 there is a text box named Subtotal. The
Control Source is set to =[Order Details Extended subform].Form!Order
Subtotal.
The problem: This box only updates if you scroll/tab down to the next
blank line in the subform.
Is there a solution to make the update happen automatically once a line
on the subform is completed?
Thank you for your assistance.
 
Lisa:

Your solution is actually simple, if I understand your situation correctly.

You need to use the Refresh command on some fields of your subform.

Place this code: Me.Refresh
in these class modules of your form

Form_AfterDelConfirm

And the same code in the class modules of these fields

Quantity_AfterUpdate

Price_AfterUpdate

Discount_AfterUpdate

***Now keep in mind I am assuming these are the names of your fields.
Change as necessary.

You might consider editing your formula in the main form also to:

=Forms!YourFormNameHere!Order Details Extended subform.Form!Order Subtotal


Good luck

Seth
 
Seth,
Thank you for your assistance. I made the changes this morning and
everything works great now!
 
Back
Top