Hi Paul,
Your scenario is a little vague, so I will set up a scenario. On a
standard form you have a button. In the button click event you will
display a messagebox that will show the count of rows from tbl1 where
the YesNo field is yes.
Private Sub command1_click()
Dim i As Integer
i = Dcount("YesNo", "tbl1", "YesNo = -1)
MsgBox "The count of rows where YesNo is Yes is " & i
End Sub
Note: For YesNo fields the actual values are either -1 (=Yes) and 0
(=No)
In the Dcount function you first enter the field you want to query and
surround it with double quotes - in our case it is the YesNo field, then
enter the table which contains this field and surrount it by double
quotes. Then enter the critieria. In this case you want to count the
rows where the value of the YesNo field is -1 (Yes) and surround the
criteria with double quotes.
Now you can click your button and bring up the messagebox with the count
of rows.
MsgBox "The Count of rows from tbl1 where YesNo is yes is " & i
Rich
*** Sent via Developersdex
http://www.developersdex.com ***