Results 1 to 3 of 3
  1. #1
    andydavidbrown is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    2

    Use Criteria Count, IF Function, or Other

    I've used the following DCount Function in my primary query which worked, but it is terribly slow and causes Access to not respond.
    PXCasework: DCount("[ID]","qry_PXCaseworkAll","[ID] ='" & [ID] & "'")

    The results are used to determine if each record in the primary query has any pending casework reflected in the related query qry_PXCaseworkAll. The number of pending casework items is irrelevant to me, I just need to know if there is any pending casework at all.



    I know I could use a manual checkbox, but I want the system to automatically flag if the record has pending casework. I've also tried the IF Function without any success. Do you have any suggestions?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    Is ID a number type field? If so, I am surprised DCount works at all. Do not use apostrophe delimiter for number field parameter.

    Build an aggregate GROUP BY query that does the count then join that query to the primary query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    andydavidbrown is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    2
    Thanks June7, that worked very well. ID is a text type field with alphanumeric account numbers.

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

Similar Threads

  1. Group by Help and Count or Sum function
    By Shilabrow in forum Queries
    Replies: 3
    Last Post: 05-18-2014, 06:21 PM
  2. Count(*) function
    By FJM in forum Access
    Replies: 18
    Last Post: 09-13-2013, 07:47 PM
  3. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  4. Using conditional COUNT function
    By Laura WW in forum Reports
    Replies: 3
    Last Post: 11-08-2011, 11:59 PM
  5. Count function grouping.
    By Tabix09 in forum Queries
    Replies: 3
    Last Post: 08-23-2011, 01:43 PM

Tags for this Thread

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