Curtis, Andrew (WAPL)
andrew.curtis at wapl.com.au
Tue Jul 6 02:11:31 CDT 2004
Connie, glad it helped. The other guys did have a valid solution as well with dcount. DCount is more friendly as there is no need for a DAO reference, however I was looking purely from SQL syntax perspective. If you never intend upsizing the app to SQL server or other database, Dcount is probably the easiest implementation. More of a personal preference thing really as the result is the goal and is achieved either way. Good luck with the rest of the app. Andrew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of connie.kamrowski at agric.nsw.gov.au Sent: Tuesday, 6 July 2004 12:44 PM To: accessd at databaseadvisors.com Subject: [AccessD] Re: Quick Syntax Question - Solved 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. -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com CONFIDENTIAL COMMUNICATION If you receive this confidential communication by mistake, please contact the sender immediately by return electronic mail. Worsley Alumina Pty Ltd ABN 58 008 905 155 is the manager of the Worsley Joint Venture - Bauxite/Alumina Operation. Liability and responsibility of the Joint Venturers is several in accordance with the following schedule of participating interests: Billiton Aluminium (RAA) Pty Ltd 56 percent, Billiton Aluminium (Worsley) Pty Ltd 30 percent, Japan Alumina Associates (Australia) Pty Ltd 10 percent, Sojitz Alumina Pty Ltd 4 percent.