If your table doesn't have a primary key field, you'll be making this more difficult, I think. Should you go the vba function route, the sql below might help with the calculation, but you'd have to figure out a way to input the date ranges. That could be a table of start and end dates, form values, array (less attractive I think) or other input. The sql as written could get you 2 values; Max of date and the average, then you'd have to find the record with that EXACT date (if you're using time, that might be a problem) and update the average.
However, it is advisable to NOT store calculations in a table, so this ought to be calculated on a form or report only.
Note - these are not formatted for vba but should be OK in sql design view. Dte is date/time field in table tblAvgData.
Code:
SELECT TOP 1 DMax("[Dte]","tblAvgData","[Dte] >=#02/01/2018# And [Dte]<= #07/01/2018#")
AS MaxDte, DAvg("[amount]","tblAvgData","[Dte] >=#02/01/2018# And [Dte]<= #07/01/2018#")
AS AvgAmt FROM tblAvgData;
If you do have an primary key ID field, then the update is safer in that the sql can return the ID of the record related to the calculation.
Code:
SELECT TOP 1 DMax("[ID]","tblAvgData","[Dte] >=#02/01/2018# and [Dte]<= #07/01/2018#") AS
MaxID, DMax("[Dte]","tblAvgData","[Dte] >=#02/01/2018# and [Dte]<= #07/01/2018#") AS
MaxDte, DAvg("[amount]","tblAvgData","[Dte] >=#02/01/2018# and [Dte]<= #07/01/2018#") AS AvgAmt
FROM tblAvgData;