Help on unbound box not updating when other box changes

new_2_prog

Registered User.
Local time
Today, 13:19
Joined
Aug 4, 2008
Messages
58
Ok, I have tried every event procedure and I must be missing something.
I have a continuous subform that has a text box "grand_total" in the subform footer that has
=Sum([Controls_Detail_Line_Qty]*[Controls_Detail_Line_Amnt]) as the control source.
Then on the main form I have a text box that references "grand_total" on the subform.
Problem, when I update/add to the continuous subform the grand_total text box updates accordingly but in return the box on the main form doesn't.
Where do I put an event procedure and what do I put for the code?

Thanks!!

:confused:
 
Are you saying that the textbox on the main form never reflects the total from the subform footer, or that it doen't update when you change a value in the subform that forces a change in the subform footer total?
 
Right, it doesn't update when I change a value in the subform which in turn changes the subform footer total.
 
So it does display the correct value when the form first opens?

What code are you using currently to assign the value to the main form textbox, and where does it reside, on the mainform or the subform?
 
As part of the Form_Load event for the main form I have the following code:

If [Form]![Quote-2 subfrm]![grand_total] = "" Then
Me.subfrm_Total = 0
Else
Me.subfrm_Total = [Form]![Quote-2 subfrm]![grand_total]
End If

Yes it does display the correct value when the main form opens but as I make changes in the subform it does not update.
 
So it does display the correct value when the form first opens?

What code are you using currently to assign the value to the main form textbox, and where does it reside, on the mainform or the subform?

Based on what missingling wrote, have you tried setting the value of the textbox in your main form from the subform when the subform value changes?

See how to refer to a mainform from the subform

This may work:
Code:
Me.Parent!ControlName=subFormControlName
 
That's the exact thing I was trying to get to. You need to include your code in the AfterUpdate event of any control on the subform that, when changed, chnages the totals box, keeping in mind what ortaias said.
 
In the subform on the text box qty for the change event AfterUpdate I entered:
Me.Parent!ControlName=subFormControlName
I tested the whole form and the main form text box isn't updating. Any ideas why this is happening? I tried something similar when I
 
Ok I got that box to work, for the control source on the text box I made it the total box on the subform, how easy was that and I missed it.
But now if the total in the subform contain null the text box in the main form that references is also null, I set the default value to 0 but that doesn't work, any suggestions?
 
Wrap them in a Nz() function.

For instance: ThisControl = Nz(ThatControl, 0)

If there is a null, the Nz function will make it 0, if not, it will leave the value.

-dK
 

Users who are viewing this thread

Back
Top Bottom