Automatically updating data in a text box

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.
 
G

Guest

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
 
L

Lisa

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Forms/Subforms Calculation issues 1
Main Form / Subform Totals 3
Form Problem 1
Form & subForm Coordination 5
NorthWind Question 7
Sub totals on sub forms 2
Forms and form buttons 1
Question regarding subform 2

Top