Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / January 2006

Tip: Looking for answers? Try searching our database.

How to pull calculated value to a field automatically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hikaru - 16 Jan 2006 03:03 GMT
In my MS ACCESS design, I have two table. Table  "COST" to hold the cost of
item in different currency and table "CURRENCY" to hold to the exchange rate
to Hong Kong Dollars. I want to do two things :

1. Within the data input Forms for table "COST", I want to show the Hong Kong
Dollar too using the field "source-cost" of table "COST" to multiply the
field "rate" of table "CURRENCY" when inputting the field "source-cost" into
the table "COST".

2. For the value calculated in step 1 ("source-cost" of table "COST" X "rate"
of table "CURRENCY"), I want this value will be automatically updated into a
field "HK-COST" in table ''COST".

Please help ! Thank you !

Hikaru
Alex Dybenko - 16 Jan 2006 08:58 GMT
hi,
you can make a query, where you join both tables and multiply necessary
values as a source for your input form, and then use form BeforeUpdate event
to assign HK-COST value calculated cost

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> In my MS ACCESS design, I have two table. Table  "COST" to hold the cost
> of
[quoted text clipped - 18 lines]
>
> Hikaru
hikaru - 17 Jan 2006 08:34 GMT
Hi Alex,

Many thanks for your quick reply. I had made a query “RATE” to hold all the
field of table “COST”. For the field “HK-COST”, I set the multiply formula on
it within the query “RATE”. I had also linked the two tables in the query.

I used the query “RATE” to make a form for input. I found that the “HK-COST”
field shows the calculated value on the form but when I go to see the content
data of the table “COST”, the “HK-COST” field had not been updated with the
calculated value (actually, there is no data). Are there any thing I had done
wrongly? Please tell me how to use the BeforeUpdate event ?

Please help.

Hikaru

>hi,
>you can make a query, where you join both tables and multiply necessary
[quoted text clipped - 6 lines]
>>
>> Hikaru
Alex Dybenko - 17 Jan 2006 12:26 GMT
Hi,
What if you open this query, and try to enter data there in a query - will
calculated field be updated?

BeforeUpdate  - add this event to your form class module, and write there

me.[NewHKCost]=me.RATE * me.Cost

NewHKCost - is a field in same table as cost. so once you have Rate or Cost
updated in a form (in this form only!) - NewHKCost  will have a updated
value.

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Hi Alex,
>
[quoted text clipped - 29 lines]
>>>
>>> Hikaru
hikaru - 18 Jan 2006 03:46 GMT
Hi Alex,

Could you send me an example ACCESS file for my case having the
"BeforeUpdate" event ?

My e-mail account : hikaru_sai@yahoo.com

Many thanks.

Hikaru

>Hi,
>What if you open this query, and try to enter data there in a query - will
[quoted text clipped - 13 lines]
>>>>
>>>> Hikaru
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.