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

Upddate Field in Table through a Control Calculation 1

Status
Not open for further replies.

JOEYB99

Technical User
Jul 9, 2008
121
CA

I am using Access 2007.

I have a form with a control that does a calculation based on two other controls, and all three are fields in the same table.

The table is called tblWorkFile and the controls are RegRate and RegHours, and these are multiplied together in the control source for RegAmount. I want the user to be able to update/change the RegHours and thereby update the RegAmount calculation which should update the corresponding field.

I am struggling with the SetValue macro command in the AfterUpdate property of the RegAmount control. I have the Item as tblWorkFile!RegAmount and the Expression is Form!RegRate against Form!RegHours.

What am I doing wrong? Can someone please help? Any input would be greatly appreciated.
 
Why storing a calculated/derived value in your table ?
You may easily retrieve an always accurate value in a query.
Have a look here:

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV for the prompt reply.

I agree with what you are saying but I inherited this database and I am in a crunch time situation.

What am I doing wrong with my macro command?
 
in the AfterUpdate property of the RegAmount control
I'd use the AfterUpdate event of the RegHours control

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV. I tried that but when I tested my macro I got a type mismatch error message.

For my Item I entered tblWorkFile!RegAmount and for my expression I entered Forms!RegHours * Forms!RegRate.

What am I doing wrong here? What exactly is not matching up here?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top