Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Developer Toolkits / April 2006

Tip: Looking for answers? Try searching our database.

Count of Yes/no Field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin - 18 Apr 2006 18:45 GMT
Hi,
I created a simple data base to count various task. Each field are Yes/No.
I'm unable to count into a report the amount of Yes for each row of a table.
Alex Dybenko - 18 Apr 2006 19:42 GMT
Hi,
if you fields have names like Task1, Task2, etc, then you can use following
loop:

for i=1 to 5
   if me("Task" & i)= true then
       Count=Count+1
   end if
next

else - you can use me.Controls collection, iterate through it, determine
type of control - and then count checkboxes

Signature

Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Hi,
> I created a simple data base to count various task. Each field are Yes/No.
> I'm unable to count into a report the amount of Yes for each row of a
> table.
Paul Overway - 24 Apr 2006 15:13 GMT
> Hi,
> I created a simple data base to count various task. Each field are Yes/No.
> I'm unable to count into a report the amount of Yes for each row of a
> table.

You need use count with a WHERE clause, i.e.,

SELECT Count(tblCustomer.Active) AS [Count]
FROM tblCustomer
WHERE (((tblCustomer.Active)=False));

Or if you wanted to use a domain function,

DCount("Active","tblCustomer","Active=True")
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.