If yourRegion above is a text field, then you will have to surround it with single quotes; ie:
[tt]
DCount("[Field]","TableName","[Region]=[red]'[/red]" & yourRegion[red] & "'"[/red])
[tt]
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
No quotes required for a YesNo, since the True or False values are represented by numbers (ie. -1 and 0); hense your code above should be:
[tt]
DCount("[Field]","TableName","[Region]=" & -1)
[/tt]
or you could just use:
[tt]
DCount("[Field]","TableName","[Region]=True"
[/tt]
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
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.