Update Avg Field

  • Thread starter Thread starter Andrew C
  • Start date Start date
A

Andrew C

I have form with Bowlers ID, Bowlers, Name and Avg Points field.

On a sub form it shows all the tournaments the bowler has competed in and at
the bottom averages out the points he has earned over the events entered.

I then want to ave points to be updated in the original form, or even better
would be for it to update the Ave Pts field in the bowlers table. How can i
get this to happen.

the two forms involved are Bowlers Pts (Main Form), Sub Form - Bowlers Query
subform.
 
The solution here is to remove the [Avg Points] field from your table.
Instead, have Access calculate the value when it needs it.
That way it can't go wrong. Computers are actually good at computing things
like that. :-)

Seriously, storing a value that is dependent on other data violates one the
the most basic rules of noralization. You can show the average in a text box
by setting it's Control Source to something like this:
=DAvg("Points" "PointsTable", "[Bowler ID] = " & Nz([Bowler ID], 0))
 
Back
Top