
Need Help with "Average" function
On the After_Update event property have an event procedure with the
following:
If Not(IsNumeric(Me![CtrlX]) Then
Me![CtrlX]=0 'Or have Me![Ctrlx]=Me![Cntrlx].OldValue, stay away from NULL
'NULL will make the Average NULL as well
Else
Me![Average Control]=(Me![Ctrl1] +Me![Ctrl2]+ ...
+Me![Ctrl7])/7
End IF
--
Steve Bliss
PS The "bye" before my email name is to prevent spam.
Remove the "bye" if sending me email.
Quote:
> URGENT! Average function needed!
> I am using ACCESS '97 to develop a testing application. This
> application will input 112 values to one record in a database. The
> values are to be numbers (0-4) or text (X). My problem is that I need to
> average a set of 7 values (from one record) and use that average to plot
> to a graph. I have developed the data entry screens and the graphing,
> but I can't seem to be able to create a function that can first evaluate
> whether the value is a number, discard non-number values and then
> average the other values.
> I do have fields on a form that I can create a calculated field from.
> I know this function can be done because the AVERAGE function in Excel
> can easily do this operation.
> Please help!
> Thanx.