Calculated controls in forms

browninaz

Ugly Data Hoarder
Local time
Today, 14:05
Joined
Oct 26, 2012
Messages
88
Hello everyone,

I have created frmInstallerInvoicing and would like to create calculated controls and store the calculated data in my tblInstallerInvoicing. The controls I have created are 'job size' which comes from control source qryInstallerInvoicing, and 'pay rate' which comes from control source tblInstallerInvoicing, and the calculated control for 'total' comes from control source tblInstallerInvoicing. I can't create a calculated field in my table because of the two different control sources, and have been told that calculated controls should be left in the forms anyways. How do I format the calculated control to dump the data calculated into the total field in my table using my property sheet?

Thanks to all who will help!
 
Thank you pbaldy, that was perfect for storing the calculated value, but how do I get the assigned controls to calculate? For example, I would like to take the job size (which is autofilled from the workorder), plug in the pay rate and have the grand total for the job calculate. I can then use the above link to store the value. Do I have to create a query to calculate the values?
 
I'm not clear on the problem. If you want to save the value, you calculate it in the after update event of the control(s) it depends on and place the result in the bound textbox.
 
Thanks for such a quick response Paul,

I am still a novice at this so it is hard to explain what I am doing sometimes. I will attach a screenshot of what my form looks like so maybe you will have a better understanding.

In the material Information box, I would like to multiply the job size, which is autofilled from another form by the pay rate which is manually filled in right now, and have the total calculate and store in tblInstallerInvoicing.
 

Attachments

  • form.jpg
    form.jpg
    98.3 KB · Views: 101
That sounds like what Allen has in the "You want to store a calculated result anyway" section. In your case perhaps you only need the code in the pay rate after update event, if the other will already be there.
 

Users who are viewing this thread

Back
Top Bottom