?
Solved

access Dcount of yes no field

Posted on 2010-08-15
4
Medium Priority
?
487 Views
Last Modified: 2013-11-28
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.

Any suggestions?

Thanks for your help.

0
Comment
Question by:johnmadigan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 1000 total points
ID: 33441059
=DCOUNT("[DrTagShip]","DoorTagLog","[BatchID] = " & [ID] & " and [DrTagShip] = True")
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 1000 total points
ID: 33441079
see the difference from your dcount

=DCOUNT("[DrTagShip]","DoorTagLog","[BatchID] = " & [ID] and "[DrTagShip] = '-1'")

revised dcount

=DCOUNT("[DrTagShip]","DoorTagLog","[BatchID] = " & [ID] & " and [DrTagShip] = -1")

0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 33441114
johnmadigan,Just for reference, internally Access stores boolean True as -1.  Thus, [DrTagShip] = True and [DrTagShip] = -1 are equvalent tests.:)Patrick
0
 

Author Closing Comment

by:johnmadigan
ID: 33441121
Thanks - I knew I was missing something with the syntax - I love a quick fix.

I am usind the Dsum in the txt field of the datasheet - any advantages to  using a subquery in the main form query to do the same thing?

thanks again for the help.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question