access Dcount of yes no field
Posted on 2010-08-15
I have a form in a datasheet view. I have a few txt fields where I use the Dsum function to show me totals on the form. Ex: for the Finish column I use:
=DSum("[DrFin]","DoorTagLog","[BatchID] = " & [ID])
This sums up the values in the table DoorTagLog for the DrFin so I can see it in the Main form which is bound to the Main JobsDoor table.
I have a field in the DoorTagLog table that is a yes/no field called DrTagShip. I have a txt field on my main form called "To Ship".
The ToShip = number of finished doors - shipped doors.
I have the number of finished doors = DSum("[DrFin]","DoorTagLog","[BatchID] = " & [ID])
I am having a hard time getting the Dcount working to figure out how many doors have shipped. Here is what I have tried so far:
=DCOUNT("[DrTagShip]","DoorTagLog","[BatchID] = " & [ID] and "[DrTagShip] = '-1'")
It returns the same value in each row of the datasheet = 1699 - I am trying to count the nunber of yes values for each Job.
Thanks for your help.