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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing a number field to update.

Status
Not open for further replies.

techkenny1

Technical User
Jan 23, 2009
182
AU
Hi,
I have a continous form that has 4 number fields that are summed in a field in the form Footer.

In the tblAccounts the number fields are [blue]D1, D2,D3,D4[/blue]
Also in the tblAccounts there are 4 fields that Total each one, [blue]D1Total,D2Total, D3Total,D4Total[/blue].

In the form Footer I have placed D1Total. On the control source of D1Total I have this code [blue]=Sum([D1][/blue].
So that when data in entered into D1 is sums the value
into the D1Total ok.

However I want the resulting value of D1Total to be recorded in the tblAccounts. When the form is saved,and I view the table data, these total fields are blank.

The question is, how can I get this data to be recorded into the table?

Many thanks.
kp

 
The question actually is "why do you want to save a value that can and should be calculated".

I would also question 4 number fields named D1, D2, D3, and D4. This suggests your table is not normalized.

Duane
Hook'D on Access
MS Access MVP
 
Hi dhookom,
Many thanks for your reply.
The 4 number fields represent the following;
[blue]D1 = Day hrs, D2 = night hours, D3 = sat hrs, D4 = Sun Hrs[/blue].
All these number fields calulate a cost per hr.
So that [blue]D1 * Rate1[/blue] gives the hrs and cost per day rate. All the rates are subject to differing rates.

But I take your point about values that should be calulated. As this is a subform I just wanted to be able to query the day hr fields without having to do a calculation.
But I take from your reply that that all calulations on forms should be calulated. So I won't pusue this line of action and just leave it to the forms to do it.

kp


 
Hi dhookom,

If you were desiging a form which had to have this type of data, how would you do it. This is the orignal db design, and I want to improve this.

On the invoice report the companies want to see all the hrs worked and rates for each criteria.
The db holds about 4000 clients, and they all can have differing rates and hrs worked.

Many thanks
kp

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top