Calculating data in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a data entry form in which specific numerical data is entered into
several different places in the same form. I placed an expression into a
text box to total these.

The problem is that the result is the total for the entire database, not
just the data in that particular form.

Is there a way to caluclate and display the data for a particular form only?
 
What are the names for the controls? What is your formula?

Is this a single form with one record displayed, or a continuous form?
 
Hi Rick,

I'm not sure why the names of the controls are important. The formula is
below. The control names are in square brackets.

=Sum(([Total Sort/Rework/Audit Time:]*43)+([Total Suspect Pieces:]*0.85))

I believe that the answer to your last question is that it is a single form.
One record that contains over a dozen separate fields. I may be mistaken if
there is a terminology issue, though.

I am self taught, mostly be trial and error... eeek!

Phil
 
If you simply want to add the values from several fields, then I don't know
why you are using SUM. That would sum values from multiple records.

To add two fields and display the result in a control, you'd just use...

[SomeField1] + [SomeField2]

I would expect your formula to be...

=([Total Sort/Rework/Audit Time:]*43)+([Total Suspect Pieces:]*0.85)




Separate issue:

Do you really have a fields called [Total Sort/Rework/Audit Time:]?

Typically, you would store separate pieces of data in fields. Calculations
would then be performed in your forms, queries and tables. If you do have a
field named [Total Sort/Rework/Audit Time:], do you also have three other
fields in your table named [Total Sort], [Rework], and [Audit Time:]? If
so, then you need to rethink your table design. What happens if you notice
a typo and change the value of [Audit Time:]? What would prompt this other
field to be recalculated?

Rick B



Phil said:
Hi Rick,

I'm not sure why the names of the controls are important. The formula is
below. The control names are in square brackets.

=Sum(([Total Sort/Rework/Audit Time:]*43)+([Total Suspect Pieces:]*0.85))

I believe that the answer to your last question is that it is a single form.
One record that contains over a dozen separate fields. I may be mistaken if
there is a terminology issue, though.

I am self taught, mostly be trial and error... eeek!

Phil

Rick B said:
What are the names for the controls? What is your formula?

Is this a single form with one record displayed, or a continuous form?
 
Hi Rick,

Yes, I actually do have a field named [Total Sort/Rework/Audit Time:]...
Sigh. It made sense at the time, but you are right when you indicate the
potential for mis-spellings, etc. Been there, done that, got the tee-shirt.
Heavy sigh.

Have been using this particular database lay-out for many years, now. Each
year I just make a copy, delete the data, change a couple of input masks,
rename... Maybe a tweak here or there. One of these days I'll find the time
to start over and do it more cleverly.

Good catch on the "Sum" function. I have no idea what I was thinking. Will
try your suggestion tomorrow when I get back to work.

Yes, I do many calculations in a number of reports and queries. Was just
looking at a way to give me a quick look at the costs associated with a
particular event represented by a particular record.

Again, will try your formula correction tomorrow and let you know. Thanks
for the incredibly quick and insightful feedback. I really appreciate it.

Phil

Rick B said:
If you simply want to add the values from several fields, then I don't know
why you are using SUM. That would sum values from multiple records.

To add two fields and display the result in a control, you'd just use...

[SomeField1] + [SomeField2]

I would expect your formula to be...

=([Total Sort/Rework/Audit Time:]*43)+([Total Suspect Pieces:]*0.85)




Separate issue:

Do you really have a fields called [Total Sort/Rework/Audit Time:]?

Typically, you would store separate pieces of data in fields. Calculations
would then be performed in your forms, queries and tables. If you do have a
field named [Total Sort/Rework/Audit Time:], do you also have three other
fields in your table named [Total Sort], [Rework], and [Audit Time:]? If
so, then you need to rethink your table design. What happens if you notice
a typo and change the value of [Audit Time:]? What would prompt this other
field to be recalculated?

Rick B



Phil said:
Hi Rick,

I'm not sure why the names of the controls are important. The formula is
below. The control names are in square brackets.

=Sum(([Total Sort/Rework/Audit Time:]*43)+([Total Suspect Pieces:]*0.85))

I believe that the answer to your last question is that it is a single form.
One record that contains over a dozen separate fields. I may be mistaken if
there is a terminology issue, though.

I am self taught, mostly be trial and error... eeek!

Phil

Rick B said:
What are the names for the controls? What is your formula?

Is this a single form with one record displayed, or a continuous form?


--
Rick B



Hi,

I have a data entry form in which specific numerical data is entered into
several different places in the same form. I placed an expression into a
text box to total these.

The problem is that the result is the total for the entire database, not
just the data in that particular form.

Is there a way to caluclate and display the data for a particular form
only?
 
Hi Rick,

No luck. Tried your suggestion of eliminating the word SUM. Now, get an
error (#Name?). Yes, all spellings are correct.

I have a feeling that I am trying to do something that can't be done. At
least in the manner and location in which I am trying to do it.

Thanks for your help.

Phil

Rick B said:
If you simply want to add the values from several fields, then I don't know
why you are using SUM. That would sum values from multiple records.

To add two fields and display the result in a control, you'd just use...

[SomeField1] + [SomeField2]

I would expect your formula to be...

=([Total Sort/Rework/Audit Time:]*43)+([Total Suspect Pieces:]*0.85)




Separate issue:

Do you really have a fields called [Total Sort/Rework/Audit Time:]?

Typically, you would store separate pieces of data in fields. Calculations
would then be performed in your forms, queries and tables. If you do have a
field named [Total Sort/Rework/Audit Time:], do you also have three other
fields in your table named [Total Sort], [Rework], and [Audit Time:]? If
so, then you need to rethink your table design. What happens if you notice
a typo and change the value of [Audit Time:]? What would prompt this other
field to be recalculated?

Rick B



Phil said:
Hi Rick,

I'm not sure why the names of the controls are important. The formula is
below. The control names are in square brackets.

=Sum(([Total Sort/Rework/Audit Time:]*43)+([Total Suspect Pieces:]*0.85))

I believe that the answer to your last question is that it is a single form.
One record that contains over a dozen separate fields. I may be mistaken if
there is a terminology issue, though.

I am self taught, mostly be trial and error... eeek!

Phil

Rick B said:
What are the names for the controls? What is your formula?

Is this a single form with one record displayed, or a continuous form?


--
Rick B



Hi,

I have a data entry form in which specific numerical data is entered into
several different places in the same form. I placed an expression into a
text box to total these.

The problem is that the result is the total for the entire database, not
just the data in that particular form.

Is there a way to caluclate and display the data for a particular form
only?
 
Back
Top