Results 1 to 3 of 3
  1. #1
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98

    Count() Until?


    Is there any methods of counting records until a certain number is hit? I have my records counted just fine, but I want to limit the count to 3. So if a record has 6 counts, I want it to stop counting that record after it reaches 3 counts. Is this possible using query criteria? If not, how would VBA look to obtain this result? I have a good sum of experience with VBA, but I haven't messed with VBA much in regards to reformatting queries.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Maybe you should select the TOP 3 for each group. Review http://allenbrowne.com/subquery-01.html#TopN
    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
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    Ill check that out, thanks. In the meantime, I used a (maybe not recommended) workaround. I created another query using an IIF statement telling to set the record to 3 if the count is < 3.

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

Similar Threads

  1. Replies: 6
    Last Post: 06-20-2017, 08:56 AM
  2. Replies: 1
    Last Post: 03-06-2017, 06:48 AM
  3. Replies: 2
    Last Post: 06-30-2016, 06:38 PM
  4. Replies: 2
    Last Post: 04-15-2014, 01:59 PM
  5. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM

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