PC Review


Reply
Thread Tools Rate Thread

Copy calculated value to a field

 
 
jenni_p
Guest
Posts: n/a
 
      7th Jun 2004
Hello -
I have a form and subform set up. There is an unbound
calculated field on the subform ContractLbs which
calculates the weight of each detail item in the
subform. I have a button that I need the user to be able
to click in the subform to "confirm" their order. In the
on click event, I need the amount in ContractLbs to be
copied to the field Contractual_Lbs which is a field
bound to the table.

Currently have have this set up in the on click event,
[Contractual_Lbs] = [ContractLbs]

The problem is that it only works for the one detail
record that you are on and I need it to appply the
command for all records in the subform at once.

Any help would be appreciated.
Thank you,
Jenni
 
Reply With Quote
 
 
 
 
Roger Carlson
Guest
Posts: n/a
 
      7th Jun 2004
Consider NOT saving the value to a table. If you can calculate it in the
form, you can calculate it in any query or report and there is no reason to
save it.

In fact, by normalization theory, you shouldn't (under most circumstances)
store calculated values. It introduces data integrity issues. What happens
if one of the values that makes up the calculation changes? If the
calculated value is stored, it does not get automatically recalculated and
is now incorrect. Calculating stuff is what the computer does best. Just
let it do it for you whenever you need that value.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

"jenni_p" <(E-Mail Removed)> wrote in message
news:18f8401c44c96$ff93d3e0$(E-Mail Removed)...
> Hello -
> I have a form and subform set up. There is an unbound
> calculated field on the subform ContractLbs which
> calculates the weight of each detail item in the
> subform. I have a button that I need the user to be able
> to click in the subform to "confirm" their order. In the
> on click event, I need the amount in ContractLbs to be
> copied to the field Contractual_Lbs which is a field
> bound to the table.
>
> Currently have have this set up in the on click event,
> [Contractual_Lbs] = [ContractLbs]
>
> The problem is that it only works for the one detail
> record that you are on and I need it to appply the
> command for all records in the subform at once.
>
> Any help would be appreciated.
> Thank you,
> Jenni



 
Reply With Quote
 
solex
Guest
Posts: n/a
 
      7th Jun 2004
Jenni,

I believe that you will need to update all of the values with a sql
statement.

For instance:

UPDATE YourSubFormTableName SET Contractual_Lbs = ContractLbs
WHERE TheWhere/FilterClauseOfYourSubForm

Dan

"jenni_p" <(E-Mail Removed)> wrote in message
news:18f8401c44c96$ff93d3e0$(E-Mail Removed)...
> Hello -
> I have a form and subform set up. There is an unbound
> calculated field on the subform ContractLbs which
> calculates the weight of each detail item in the
> subform. I have a button that I need the user to be able
> to click in the subform to "confirm" their order. In the
> on click event, I need the amount in ContractLbs to be
> copied to the field Contractual_Lbs which is a field
> bound to the table.
>
> Currently have have this set up in the on click event,
> [Contractual_Lbs] = [ContractLbs]
>
> The problem is that it only works for the one detail
> record that you are on and I need it to appply the
> command for all records in the subform at once.
>
> Any help would be appreciated.
> Thank you,
> Jenni



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy calculated field NetNewbie Microsoft Excel Discussion 1 7th Jan 2010 01:32 PM
Copy a calculated field Gino59 Microsoft Excel Misc 3 28th Jul 2009 02:31 AM
Copy a result of calculated control to another field TKI Microsoft Access 5 27th Mar 2008 04:46 AM
Copy a calculated field from one report to another =?Utf-8?B?U29ueWE=?= Microsoft Access Reports 12 27th May 2005 03:00 PM
Copy value calculated field subform to a field kderaedt Microsoft Access Form Coding 0 30th Jun 2003 08:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:14 AM.