Calculated coumn results from a form into a table

V

vinchacho

Access 2003


I have a calculated field in my form that i want to go into my table but it
doesn't. My question is, how do i get the results of the calculated column
into my table.
 
A

Al Campagna

vinchacho,
As a general rule, you don't. Given that you have saved the elements of
the calculation, you can always re-calculate the the column, "on the fly",
in any subsequent form, query, or report.
If you must save the calculation... (for example Price * Qty = Line
Total)
Add a field to your table called LineTotal. Place that field on your
form. When either Price or Qty have been entered, and using the AfterUpdate
of either field...

Private Sub Price_AfterUpdate()
LineTotal = Price * Qty
End Sub
(use the same code for Qty AfterUpdate)

That will save the results to the LineTotal field.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
V

vinchacho

Al Campagna said:
vinchacho,
As a general rule, you don't. Given that you have saved the elements of
the calculation, you can always re-calculate the the column, "on the fly",
in any subsequent form, query, or report.
If you must save the calculation... (for example Price * Qty = Line
Total)
Add a field to your table called LineTotal. Place that field on your
form. When either Price or Qty have been entered, and using the AfterUpdate
of either field...

Private Sub Price_AfterUpdate()
LineTotal = Price * Qty
End Sub
(use the same code for Qty AfterUpdate)

That will save the results to the LineTotal field.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."





Al Campagna
 

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