I don't see the relationship between the tables - unless you are using MSKU and/or product name. You haven't answered all my questions so I'm still guessing
Also not clear why you would want to store the average when it can be calculated as and when. It is normally bad practice to store calculated values
no idea what you mean by 'automatically update' - when? you have a new purchase? its a Monday?
to calculate the average will require a group by query, and you cannot use sql to update an existing record using aggregate queries, so you will need to use vba code
something like this in principle, you can adapt it to run on a button or other event
Code:
dim sqlstr as string
dim rst as dao.recordset
sqlstr="SELECT productname, avg(cost) as avcost FROM purchases GROUP BY productname"
set rst=currentdb.openrecordset(sqlstr)
while not rst.eof
currentdb.execute("UPDATE products SET avCost=" & rst!avcost & " WHERE productname='" & rst!productname & "'")
rst.movenext
wend
rst.close
set rst=nothing
for future reference, be clear and provide all relevant data so people can provide a more focused response. I suspect the above is still not enough to meet your requirements, but due to other commitments I am no longer in a position to respond.
good luck with your project