Sum to get totals problem. (1 Viewer)

Howlsta

Vampire Slayer
Local time
Today, 03:38
Joined
Jul 18, 2001
Messages
180
Folks,

I've got my continuous form which has a sub query as its record source. The sub query is based on a xtab query.
The columns in the form represent age ranges and each range has a count and percentage for the type of child restraint used. All I want to do is have a total for each column in the footer. I'm using the correct syntax for example the first column's control source is 0-9 mths:

=sum([0-9 mths])

I then go into form view and get #name?

Can't be due to the '-' or spaces because I have one called [total] which also gives the same error.
I also have another form which uses a sub query based on a xtab, but that totals everything fine.

Any ideas as to what the problem is?

Rich

btw some of the fields in the form are null, but this hasn't caused a problem in my other forms when totalling them.
 
Last edited:

aronw

Registered User.
Local time
Today, 03:38
Joined
Dec 2, 2002
Messages
31
Not sure if I can help but I had a slightly similar situation.

Do you need to store the calculated value in a field? (needed for something else other than the form)

If it is just the form, use a text box and put your =[month1]+[month2] etc. in the control source property. When I wrote it out the long way instead of using the 'sum' function it started to display the value rather than the #name strangely.

Hope this helps in some way

Aron ;)
 

Howlsta

Vampire Slayer
Local time
Today, 03:38
Joined
Jul 18, 2001
Messages
180
I would try that, but unfortunately it doesn't apply in this particular case as i'm in continuous forms. I'm getting columns of data and each field in the column has the same control source.

Alternatively how can I do this with code?

thanks

Richy
 

Howlsta

Vampire Slayer
Local time
Today, 03:38
Joined
Jul 18, 2001
Messages
180
I took out all the totals fields in the form footer, copied and pasted the form gave it a different name and tried adding the fields again one by one with the expressions it's now doing the calculations! I suppose you have to expect stuff like this with a Microsoft product!

Rich

EDIT - I've found out why it is going it now. It seems to be related to the number of controls on the form, if there are too many controls Access won't do the calculation. Has anyone else experienced this???????????????
 
Last edited:

Users who are viewing this thread

Top Bottom