Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Sum Issue

Status
Not open for further replies.

GarstonMassive

Programmer
May 5, 2006
71
GB
Hi,

I have a subreport on a main report. On this subreport I have a running sum textbox called txtSum in the Detail section. In the report footer I have another textbox txtOverallTotal whose control source is set to txtSum in the Detail section. The textbox in the footer displays the correct total.

The problem is when I try to refer to txtOverall from a textbox on the mainreport it always displays the first figure in the calculation and not the overall total.

Can anyone explain why??!! I'm pulling my hair out!
 
Can you provide the code you use to refer to txtOverall?

My guesses would be either field lengths and/or formats, first.
 
I refer to txtOverallTotal from the textbox on the main form using:

ControlSource = Child166.Report!txtOverallTotal

I dont think it's a problem with referencing cos when I hard code a value into txtOverallTotal it displays fine on the main form.

A bit more background:

the subform has a value textbox. txtSum is the running sum of this textbox. Both of htese are in the Detail section. txtOverallTotal is in the report footer whose controlsource is set to [txtSum].

Thanks for your help.
 
Is it not possible just to set the value of the main form box to that of the subform box via code?

.Value = Child166.Report!txtOverallTotal.Value

or

.value = Child166.Report!txtOverallTotal.Text
 
I did already try doing this but I got an error saying that I had to set focus to the control before I could do so and then when I tried doing that the whole thing fell over!

I got round it in the end by putting 2 text boxes one on top of another and switched on their visible property depending on which one I wanted to be displayed.

Thanks for your timely help though.

It's what makes this site so good.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top