Dim lngMyCount As Long
lngMyCount = DCount("scMailTag","tblSubs","scMailTag = True"
This assumes scMailTag is a yes/no field.
Duane
MS Access MVP
Find out how to get great answers faq219-2884.
This query returns a recordset with one row and one column so assign the result of the query to a recordset and the value of RS.Field(0) is what you want.
It might be better to phrase the sql query as:
Select Count(scMailTag) As MailCount
From tblSubs
Where scMailTag = yes
then you can refer to the return value by the column name "MailCount"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.