Stuart McLachlan
stuart at lexacorp.com.pg
Sun Jul 4 20:56:40 CDT 2004
On 5 Jul 2004 at 9:36, Curtis, Andrew (WAPL) wrote: > Additional to my last: > > Heres the solution, modify to suit your fields, this needs a reference > to DAO. > > Dim sqltext, specific As Integer > Dim db As dao.Database, rs As dao.Recordset > Set db = CurrentDb() > > sqltext = "SELECT count([id]) as countMe FROM Table1;" > Set rs = db.OpenRecordset(sqltext) > specific = rs.Fields("countMe") > rs.Close > Set db = Nothing > > Or more simply, just Dim Specific as Long Specific = DCOUNT("ID",Table1) -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support.