Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I get calculations in a form to go into that field in the table?

Status
Not open for further replies.

jimrawr

MIS
Oct 8, 2005
16
US
I have some calculations in my form and I need those calculations to go into the table.. how can I do this?

Thanks for all the help
 
anyone? I need to be able to input data into a form, and some of the entries to be automatic calculations.. and I need those calculations to go into the table so I have some way of viewing all the entries and not having to look at them one by one on the form..
 
Jim,

First off, give folks some time to react--no one here is getting paid to answer questions.

What you want to do here is build a query that does those calculations on the fly. Calculated fields should almost never be stored in tables. You can use the same calculations in your queries that you use in your forms and you'll get something that looks a whole lot like a table with the calculated fields in it. If you want, you can make a report based on the query to make the data easier to read.

Jeremy

---
Jeremy Wallace
METRIX Lead Developer
Fund for the City of New York
http:// metrix . fcny . org
 
Thanks for the reply... where do I add in the code if I am using a query? In design view, then ??

Thanks, I am really nice to access as you can tell and I really appreciate the help

 
Yes, in design view. You can put something like this in one of the cells that normally holds just a field name:
[Field1] + ([field2]/[field3])

Jeremy

---
Jeremy Wallace
METRIX Lead Developer
Fund for the City of New York
http:// metrix . fcny . org
 
When I enter in [misc fees]+[discounting fees] and then try to run the query it asks me for parameter value, whats that?
 
Sorry. That was a silly mistake on my part. You have to make up a name for the new field:
TotalField: [misc fees]+[discounting fees]

Jeremy

---
Jeremy Wallace
METRIX Lead Developer
Fund for the City of New York
http:// metrix . fcny . org
 
for some reason its still not adding them up... It makes the new field when I view the query, but its empty.

Any idea why?
 
Are there values in the other fields?

You might want to wrap both fields in the Null-To-Zero-Length-String function, like so:
TotalField: nz([misc fees])+nz([discounting fees])

If that doesn't work, try something simpler first:
NewField: 1

That should show a one in every record. If not, something else is wrong.

Are both fields numeric or both currency? Should be.

If you're still having trouble, open the query in SQL view and paste the sql here.

Jeremy

---
Jeremy Wallace
METRIX Lead Developer
Fund for the City of New York
http:// metrix . fcny . org
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top