View Full Version : Pesky Sum Text Problem - I Have Searched The Forum


John Jnr
08-22-2002, 01:28 AM
I have a report generated from a form.

In the report I have grouped Expense Type generating a Expense Type Header.
I put this calculated field in the header:
=Sum([ExpenseYear])
And everything works perfectly.
However . . . . . If I put this in:

=Sum("[" & [Forms]![Form6]![Combo0] & "]")

I get that pesky #error

Is it my syntax?

Help much apppreciated.

Cheers

J
:rolleyes:

bradcccs
08-22-2002, 01:40 AM
I am not 100% sure why you are doing this but . .

Check the bound column of your combo box. The value of the bound column is what will be returned by your forms!form6.combo0 argument.

Eg: If you have the ID column bound (eg: id = 6) it will result in sum([6])

You may need to specify the column that you wish to obtain the info from.

HTH

Brad.

John Jnr
08-22-2002, 02:39 AM
Brad,
As ever I played and played then finally cracked it:
I wrote the control source into VBA as:
Text79.ControlSource = "=Sum(" & "[" & [Forms]![Form6]![Combo0] & "]" & ")"

Works fine.

Thanks

J:)