Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    513

    dcount criteria

    I'm trying to determine if there are any records in a table where a particular field has an entry:

    Code:
            vCntDetail = DCount("[Tag]", "tbeTagDetails", Len([Reqmnt_Detail]) > 0)
    Instead it returns the number of records (total in the table.)
    my hunch is that I can't use a function in the dCount() criteria (or at least not in this manner ?)

    any thoughts, comments or suggestions will be greatly appreciated in advance,
    mark

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    You might try
    vCntDetail = DCount("[Tag]", "tbeTagDetails", "Len([Reqmnt_Detail]) > 0" )
    Examples at
    https://www.techonthenet.com/access/...ain/dcount.php

    A sample from one of my tables:
    Code:
    ?dcount("*","ComparisonOutput","len(datatype1)>0")
     2

  3. #3
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    513
    BANG . that was it

    ("..whens all else fails, check the obvious")

    thnx

Please reply to this thread with any new information or opinions.

Similar Threads

  1. DCOUNT Muliple criteria
    By civl_eng in forum Access
    Replies: 11
    Last Post: 05-03-2018, 12:27 PM
  2. Criteria issue with DCount
    By JimO in forum Access
    Replies: 10
    Last Post: 08-29-2017, 11:56 AM
  3. Using DCount, how to use a variable as the criteria
    By crowegreg in forum Programming
    Replies: 2
    Last Post: 02-17-2015, 05:18 PM
  4. DCount with Multiple Criteria
    By Newbie11 in forum Reports
    Replies: 4
    Last Post: 05-25-2012, 09:04 AM
  5. How do you use DCOUNT for multiple criteria?
    By wwhit in forum Programming
    Replies: 5
    Last Post: 05-15-2012, 11:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums