Refresh or requery problem

PaulJK

Registered User.
Local time
Today, 23:10
Joined
Jul 4, 2002
Messages
60
Hello,

I am looking for a way to ensure a sub form is refreshed or requeried.

I have forms as follows:

1.form for Purchases
2.subform for all items purchased
3.subform which has the total purchase price ie the total of all items in the subform 2 above

A save is forced in 1 before data in 2 is entered. Once 2 is exited a save if forced. However 3 is not calculated unless a manual refresh is performed.

I am sure there must be a way around this. Any suggestions would be helpful.

Thank you.
 
Can you not put the grand total inside the subform 2 so you can actually see the output in real time instead of saving it and doing the calculation?

The only solution I can see in here is that you can do the calculation inside no 2 otherwise your no3 will wait until you save the data in 2 and refresh it
 
Thank you for your reply.

Form 2 could have a number of items purchased. Whilst each item is totalled, form 3 provides the total of all items in form 2.

I have experimented with: Me.Parent.form3.Requery. However I have tied on Before Update, After Update, On Close etc. but cannot achieve the desired result. Reading other posts it looks like Me.Parent.form3.Requery is the answer, but I just need to find where to place to code.

Would welcome any pointers.
 
Since you wrote that each item in no 2 is totalled, why not put the me.parent.form3.refresh on the code (which is no2) where calculation is made.

You can do this after each item total is computed.

i.e: nQuantity * nPrice
me!parent.form3.refresh
 

Users who are viewing this thread

Back
Top Bottom