Sorry, but the code seems to have a problem.
For example, if the query is named 'Test Query', I want to know the median value of its field 'rate', and the query has a criteria for field 'Date', like 'between [Forms]![Date Buffer]![BeginDate] And [Forms]![Date Buffer]![EndDate]', then if we use...