hi to all
I'm struggling with a function that is giving me grief. Here's the situation:
I have 5 textboxes that each can hold numbers formatted to show 3 decimal places.
[tt]
txtA, txtB, txtC, txtD, txtAVG
4.600 4.550 4.600 4.545 4.575
[/tt]
Values can be entered into any of the first 4 textboxes. txtAVG can display 'greyed' results, but it has enabled = False.
If the first 4 textboxes all have values, then txtAVG must show the average of the 'middle' two values after the top and bottom are discarded (yes, doubles are common!) In the example above, we find the average of 4.550 and 4.600.
If only three (any three!) of the text boxes have values, then txtAVG must show the average of all three.
If only two of the text boxes have values, then txtAVG must show their average.
If only one of the textboxes has a value, then txtAVG must show that value.
I'm feeling rusty with writing this function and would really appreciate help. I'm guessing the function would run in the after_update event of the 4 textboxes.
many thanks
Vicky C.
I'm struggling with a function that is giving me grief. Here's the situation:
I have 5 textboxes that each can hold numbers formatted to show 3 decimal places.
[tt]
txtA, txtB, txtC, txtD, txtAVG
4.600 4.550 4.600 4.545 4.575
[/tt]
Values can be entered into any of the first 4 textboxes. txtAVG can display 'greyed' results, but it has enabled = False.
If the first 4 textboxes all have values, then txtAVG must show the average of the 'middle' two values after the top and bottom are discarded (yes, doubles are common!) In the example above, we find the average of 4.550 and 4.600.
If only three (any three!) of the text boxes have values, then txtAVG must show the average of all three.
If only two of the text boxes have values, then txtAVG must show their average.
If only one of the textboxes has a value, then txtAVG must show that value.
I'm feeling rusty with writing this function and would really appreciate help. I'm guessing the function would run in the after_update event of the 4 textboxes.
many thanks
Vicky C.