I am trying to use the following query to generate a variable in VB:
strSQL = "SELECT Count(tblChildAttend.ChildID) AS CountOfChildID "
strSQL = strSQL & "FROM tblChildAttend "
strSQL = strSQL & "GROUP BY tblChildAttend.[Service ID], tblChildAttend.Date, tblChildAttend.Present "
strSQL = strSQL & "HAVING (((tblChildAttend.[Service ID])=[Forms]![frmAttendance]![childService ID]) AND ((tblChildAttend.Date)=[Forms]![frmAttendance]![chattenddate]));"
Could some one please help by suggesting the code I would need in VBA to turn the CountOfChildID into a TEMP variable that I can use elsewhere in the procedure I am trying to put together? Does this require the use of recordsets?
Many thanks
strSQL = "SELECT Count(tblChildAttend.ChildID) AS CountOfChildID "
strSQL = strSQL & "FROM tblChildAttend "
strSQL = strSQL & "GROUP BY tblChildAttend.[Service ID], tblChildAttend.Date, tblChildAttend.Present "
strSQL = strSQL & "HAVING (((tblChildAttend.[Service ID])=[Forms]![frmAttendance]![childService ID]) AND ((tblChildAttend.Date)=[Forms]![frmAttendance]![chattenddate]));"
Could some one please help by suggesting the code I would need in VBA to turn the CountOfChildID into a TEMP variable that I can use elsewhere in the procedure I am trying to put together? Does this require the use of recordsets?
Many thanks