Dcount is counting everything

Posted on 2006-05-25
Last Modified: 2012-05-05
I have the following dlookup in an unbound report text box:


I need to count all the records that is related to the record in the report. Currently it is counting all the records in the table "tblPinch".

Any ideas???


Question by:perennial
    LVL 44

    Accepted Solution

    I'm guessing you really want something like

    =DCount("[PinchPk]","tblPinch","[PSDPk]='" & Me.[PSDPk] & "'")
    LVL 27

    Expert Comment


    or if PSDPk is a numeric field, then

    =DCount("[PinchPk]","tblPinch","[PSDPk]=" & Me.[PSDPk])
    LVL 1

    Author Comment


    Thanks, I got to get my quotation straight.


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    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…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now