<html>
<body>
Hello to all those who answered my request for assistance on subqueries
that I ended up solving with a DSum. Here is the function I ended up
using, in case it is of interest to anyone. It obviously requires a bit
of background to the structure of my application, but you get the idea of
what the function is doing.<br>
Cheers<br>
David<br><br>
<br>
<font face="arial" size=2>Public Function TotalHolidayWeeks(intCampus As
Integer, datStartDate As Date, datEnddate As Date) As Integer<br><br>
    'Calculates the number of weeks holiday for a campus
between two given dates<br><br>
    Dim strCriteria As String<br><br>
    strCriteria = "(CampusID=" & intCampus
_<br>
        & ") AND ((StartDate)
> #" & Format(datStartDate, "dd/mmm/yyyy") &
"#) " _<br>
        & "AND ((EndDate)
< #" & Format(datEnddate, "dd/mmm/yyyy") &
"#)"<br><br>
    TotalHolidayWeeks = Nz(DSum("Weeks",
"tblCourseHolidays", strCriteria), 0)<br><br>
End Function<br>
</font></body>
</html>