putting average of some fields in another field thru form

manishmeta

Registered User.
Local time
Today, 17:25
Joined
Sep 3, 2013
Messages
13
Hi,

I want to calculate the average of 16 anodes from text box into the "average drop" box and simultaneously want the data to be saved in the table too as one of the fields. Also, How to load form view while the database loads?

Thanks in advance.
 

Attachments

Last edited:
I am using access 2010
First Point is that it is bad practice to save a calculated field to a table as it always there when you want it. It can be done by creating a cmd button and coded like this : txtaverage = txt1 + txt2

For you calculated field i recommend the use of Nz eg =(Nz([anode1],0)+Nz([anode2],0))/16 ,,and so on
( as this will take care of nulls)
Finally if you press the Shift key when opening the form you should be in design mode.
or just click the design mode icon ,
Hope this is of use to you
Regards
 
Last edited:
Hi,

I want to calculate the average of 16 anodes from text box into the "average drop" box and simultaneously want the data to be saved in the table too as one of the fields. Also, How to load form view while the database loads?

Thanks in advance.

If you want more people to look at your Database I suggest posting it in Access 2003 format.
 
Rainlover As i am up and about i have taken the liberty of saving the subject database in ac2003 fomat to enable, as you suggest a wider viewing and a solution for Manishmeta

Regards Ypma
 

Attachments

Rainlover As i am up and about i have taken the liberty of saving the subject database in ac2003 fomat to enable, as you suggest a wider viewing and a solution for Manishmeta

Regards Ypma

Thanks for that.

I will have a look
 
Friends, I coudn't find a solution to my problem even after having so many experts out here. :(
 
You did not get back my post #2 so assumed you were happy, I will attach a copy of your db with one way to achieve what you asked. i have added my changes in Red. If i have not understood the requirement please come back to me.

Regards
 

Attachments

Friends, I coudn't find a solution to my problem even after having so many experts out here.

What you have is several controls that need to be summed then divided by the number of controls. (A control in this case is a text box)

I do not know,

The Number of Controls.
Is every Control used every time.
If a Control is empty does it still get included.

A possible solution is to use VBA.

Create a loop that validates each entry and if successful count the control plus add the value of the control until you reach the end. Then divide the Sum by the Count for the average.

There are many other possible solutions depending on your circumstance.

Please let us know how you are going.
 
Rain Lover "I assume this thread is closed."

Your guess is as good as mine . I have not even had a curtsy reply to my suggested solution ,so due to lack of communication i am moving on
Regards Ypma
 

Users who are viewing this thread

Back
Top Bottom