Update totals

callumwatson

Registered User.
Local time
Today, 20:25
Joined
Jun 22, 2001
Messages
22
I have a subform on my main form which I use to calculate a total in. I then display the total again in my main form. My problem is that the value is not displayed automatically in my main form. I have to pass the mouse pointer over it before it appears.

Does anyone know how to solve this problem?
 
It sounds like you need to Requery the text box that holds the calculation on the main form. On whatever event you trigger the calculation on the subform, add code to Requery the other field.

Me.[name_of_text_field].Requery

You may have to use:

Forms![frm1]![name_of_text_field].Requery

Paul
 
I tried what you said but the value still isn't displayed automatically. I had a look at the Northwind sample database's Orders form. I see that the totals on it update immediately but I can't find the code which does it. This may be of some help to me if someone could tell me how to find out how the Orders form update works.
 
There isn't any code the control source is just set to the text box on the subform that displays your subform total. It sounds as though you have some event taking place on your mouse move maybe.
 
I have no events taking place when I move the mouse over the textboxes. All I have is a refernce to the total box on my subform.

e.g I have a Valuation total text box on the main form which has the following in it's control source property:

=[Valuation subform].[Form]![Text7]

Text7 is the name of the textbox holding the sum in the subform.

It is as if when the main form is opened it doesn't even acknowledge the subform. The fields are linked but the values just don't come up automatically in my main form.
 
Would anyone be willing to take a look at my form if I was to sent them it along with the requirec tables?
 
i downloaded your .mdb but their is a problem when i open it or should i say, i cannot open it. i will welcome if you send another copy!
 
I finally solved my problem. I had my textboxes on a tab control along with my subforms. However, the tab control was in the header of my form instead of in the details section.
I should have noticed such an obvious mistake and I definitely won't make it again.

Thanks to everyone who tried to help me.
 

Users who are viewing this thread

Back
Top Bottom