[AccessD] Re: Quick Syntax Question - Solved

connie.kamrowski at agric.nsw.gov.au connie.kamrowski at agric.nsw.gov.au
Mon Jul 5 23:43:56 CDT 2004


Thanks guys , my sanity is saved. I used Andrews solution as it was the
first I got. I haven't tried the rest but Andrews works fine.

Regards
Connie Kamrowski

Message: 7
Date: Mon, 05 Jul 2004 11:56:40 +1000
From: "Stuart McLachlan" <stuart at lexacorp.com.pg>
Subject: RE: [AccessD] Re: Quick Syntax question
To: Access Developers discussion and problem           solving
             <accessd at databaseadvisors.com>
Message-ID: <40E941F8.14608.AD16881 at lexacorp.com.pg>
Content-Type: text/plain; charset=US-ASCII

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.



This message is intended for the addressee named and may contain
confidential information. If you are not the intended recipient or received
it in error, please delete the message and notify sender. Views expressed
are those of the individual sender and are not necessarily the views of
their organisation.





More information about the AccessD mailing list