Subtotals

G

Guest

I am new to this so please understand.

I have a form and within that form the user inputs expenses. What I am
looking to do is to add =sum([field1] + [field2] + [field3] + [and so on])
giving me a subtotal. I have tried subtotal = [field1] + [so on]. I have
tried putting the formala into the default section on the bound subtotal
properties still no use.

Help please this does not work...
 
G

Guest

I am assuming that you want a field that will automatically update. Create an
unbound text box. Make the controlsource = sum of the fields the way you were
doing it, but not in the default field. You may need to convert the values
first using the c functions like cint() or cdbl(). Now I know that this works
on a single form, if you are using a subform, your function may need to be
more complex and I would probably have a function behind the form that is a
bit more complex and possibly includes a sum query.

Let me know if this works and if I can do anything more to help.
 
G

Guest

I did ask you said, but went from #ERROR to #NAME to blank in the form text
box. here is what I tried

What am I doing wrong?

Thank You in advance....

In the Control Source of a Text Box my expressions were:
=Sum(Me.Field1 + Me.Field2 + ETC.)
then I tried
=Sum([Me].[Field1] + [Me].[Field2] + [ETC])
then I tried
=Sum([Field1] + [Field2] + [ETC])
Then
=([Field1] + [Field2] + [ETC])
then
=(Me.Field1 + Me.Field2 + ETC.)
then
=Me.Field1 + Me.Field2 + ETC. <= this was a real bad move it locked up my
form when I opened it and would not let me close without a force close. Then
for some unknown reason when closing in design view it would not ask if I
wanted to save or not, it would just automaticely save. So what I had to do
was reboot the computer.

then I tried
=[Field1] + [Field2] + [ETC]
then I tried
=SUM([Field1] + [Field2] + [ETC]) <= in the Form Footer section
Still not working....



hmadyson said:
I am assuming that you want a field that will automatically update. Create an
unbound text box. Make the controlsource = sum of the fields the way you were
doing it, but not in the default field. You may need to convert the values
first using the c functions like cint() or cdbl(). Now I know that this works
on a single form, if you are using a subform, your function may need to be
more complex and I would probably have a function behind the form that is a
bit more complex and possibly includes a sum query.

Let me know if this works and if I can do anything more to help.

Amour said:
I am new to this so please understand.

I have a form and within that form the user inputs expenses. What I am
looking to do is to add =sum([field1] + [field2] + [field3] + [and so on])
giving me a subtotal. I have tried subtotal = [field1] + [so on]. I have
tried putting the formala into the default section on the bound subtotal
properties still no use.

Help please this does not work...
 
G

Guest

Here is something to try:

Make sure that your text boxes do not have the same names as the fields. I
know that by default it does this for you. I like to put the prefix of txt in
front of text boxes, cbo for combo boxes, etc.

Then try the version where you say =([txtField1]+[txtField2]+...).

This will sum up the text boxes that you are looking at and not get them
mixed up with the fields in the data. I also think that the data is not
updated until you move to another record.

Now, I don't think that I saw any mention in your note about whether you are
using a subform or just a continuous form.
 
G

Guest

Hi,
Well, that still did not work(#ERROR). So let me understand, U want me
to change the Names in each Text Box(Under Names option) to TXTField1 and so
on. Then Change the text box for the subtotals(Under Control Source) to:
=([txtField1]+[txtField2]+...).? This is a continuous form I am using....

Thank You For Helping!
 
G

Guest

if that did not work out you can email me your project and I can look into it
further. Just email without the double dashes
k--a--r--e--n--y--y--y--1--at--c--o--m--c--a--s--t--dot--n--e--t

Amour said:
Hi,
Well, that still did not work(#ERROR). So let me understand, U want me
to change the Names in each Text Box(Under Names option) to TXTField1 and so
on. Then Change the text box for the subtotals(Under Control Source) to:
=([txtField1]+[txtField2]+...).? This is a continuous form I am using....

Thank You For Helping!

hmadyson said:
Here is something to try:

Make sure that your text boxes do not have the same names as the fields. I
know that by default it does this for you. I like to put the prefix of txt in
front of text boxes, cbo for combo boxes, etc.

Then try the version where you say =([txtField1]+[txtField2]+...).

This will sum up the text boxes that you are looking at and not get them
mixed up with the fields in the data. I also think that the data is not
updated until you move to another record.

Now, I don't think that I saw any mention in your note about whether you are
using a subform or just a continuous form.
 
B

BMore via AccessMonster.com

1) textboxes and inputting expenses???? hope your table uses numbers. But in
case you are using textfields, use Val(ZField1). One possible cause of error
might be that you are using the wrong decimal sign, a textbox is not checking
which is used.
2) the second replay was the correct answer:
Make an unbound field and set the controlsource to =[Field1]+[Field2] etc

I'm guessing you do not want to sum fields, but you want to sum a field in
subset of records and that is a diffirent ballgame.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top