save calculate value

Z

Zina

I have design a form that enter information of some goods , I enter Price per
unit of item and quantity of item ,then I calculate the total price of that
item ,I want to save the new calculated value in field I mean I want to save
vallue in the related field of its related table

Thanks in advance
 
S

Stefan Hoffmann

hi Zina,
I have design a form that enter information of some goods , I enter Price per
unit of item and quantity of item ,then I calculate the total price of that
item ,I want to save the new calculated value in field I mean I want to save
vallue in the related field of its related table
Why would you do that? In a database you normally never save/store
calculated values.

To (re-)use calculated values create a query based on that table:

SELECT *, Price*Quantity As TotalPrice
FROM yourTableName

This is the queries SQL.

Just use this query as record source for your forms and your done.



mfG
--> stefan <--
 
G

GBA

presuming your underlying table has a 'Total' field; and that this field also
exists on your design form; then
in the 'AfterUpdate' event of the quantity field put:
me.Total=me.price*me.quantity

that will simply automate that math for your user
 

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