northernstar

11-07-2007, 12:04 AM

morning all

i have a form which has a few text boxes on it and i have wrote the code to find the average of the 4 boxes (added them together then divided by 4, used .controls, val and .text

now i would like to find the varition between the 4 for example if the 4 values are

1, 1.005, 1.003 and 1.002

the variation is 1.005-1.000=0.005

basically the max-min but vba doesnt appear to recognise max and min unless i am doing something wrong?

also would like to set the format of the boxes used

textbox1= format(textbox1,"0.0000") which works fine if i use a BeforeUpdate event but this relies on moving to another box which is ok until you reach the last box?

i would appreciate if anyone could point me in the right direction

thanks in advance

i have a form which has a few text boxes on it and i have wrote the code to find the average of the 4 boxes (added them together then divided by 4, used .controls, val and .text

now i would like to find the varition between the 4 for example if the 4 values are

1, 1.005, 1.003 and 1.002

the variation is 1.005-1.000=0.005

basically the max-min but vba doesnt appear to recognise max and min unless i am doing something wrong?

also would like to set the format of the boxes used

textbox1= format(textbox1,"0.0000") which works fine if i use a BeforeUpdate event but this relies on moving to another box which is ok until you reach the last box?

i would appreciate if anyone could point me in the right direction

thanks in advance