You construct a SQL string with the SELECT and GROUP BY clauses, and use that with OpenRecordset.
For example:
Dim rs as DAO.Recordset
Dim sSQL as string
sSQL = "SELECT City, Count(CustomerID) as CustCount FROM Customers GROUP BY City;"
Set rs CurrentDb.OpenRecordset( sSQL )
--
Graham