Running Sum On Unbound Text Box

John Jnr

Registered User.
Local time
Today, 14:33
Joined
May 2, 2002
Messages
36
I have a form that is generated from combo box selections.
In the detail section of this form the text boxes are unbound but obviously controlled from the combo selection.
I want to sum these text boxes in the footer of the form.
I have put in the footer: =Sum([Textx]) and when the form opens I get this displayed: #NAME?
Is there something wrong with the syntax?

Your help as ever is much appreciated.

Cheers

J:rolleyes:
 
You cannot refer to controlnames in aggregate functions. If Textx is a calculated value, you can repeat the calculation within the aggregate function.

=Sum(fldA * FldB)
 
Running Sum on Unbound Text Box

Thanks for the reply Pat but I am none the clearer?
What I have is a user select front end of a financial budget plan.
The user selects four years from 4 combo boxes. Then when the form button is pressed the VBA on the on open is as follows:

Text13.ControlSource = [Forms]![Form1]![Combo0]
Text17.ControlSource = [Forms]![Form1]![Combo12]
Text30.ControlSource = [Forms]![Form1]![Combo34]
Text32.ControlSource = [Forms]![Form1]![Combo36]
Me.Filter = "Sourcedata.BUCC=" & "'" & [Text24] & "'"
Me.FilterOn = True

The filter allows the user to select his department.

When the form opens the form is filtered, has the project codes and descriptions and a four year plan with financial info under each yearly field.

I want to sum each text box? So I have a running sum for each year in the footer.

You say it's not possible? Then why can I do calculations on the unbound text boxes?

Your help Pat is eagerly awaited.

Thanks;)
 
I suspect DSum is your easy answer, assuming I read this correctly
 
Cracked it with Dsum

Pat,
I have got round the problem with a Dsum back to the source table but using the combo selections for the sum field and criteria as follows:

=DSum("[" & [Forms]![Form1]![Combo0] & "]","Sourcedata","[BUCC]=" & "'" & [Forms]![Form1]![Combo32] & "'")

Please don't tell me I am breaking rules??!?!?!??!:rolleyes:


Cheers

John
 
Thanks Rich I was working on it when you posted your note.

No doubt I will be back.:)

Cheers

John
 

Users who are viewing this thread

Back
Top Bottom