Results 1 to 10 of 10
  1. #1
    sherrygroves is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    23

    User Prompts and Count function

    Hi!



    I am using several queries with Region Codes coded in the query. My reports are also based on the individual queries and has a Record count statement as well --
    =DCount("[State]","Reporting Query1"). All is working fine.

    Now to minimize the number of queries I need to write, I want to prompt for the Region code. I can do that [Enter Region Code:]. It prompts and the report shows the expected output (only records for that region code) BUT my count statement ceases to work and I get #Error instead of the number of records. This happens no matter which field I set to prompt.

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Might be helpful to review this article. http://allenbrowne.com/RecordCountError.html

    HTH

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Why use domain aggregate? Could you just do Sum(*) in textbox on report and get the correct count?
    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.

  4. #4
    sherrygroves is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    23
    I used the domain aggregate because it is the only count function I could get to work.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Ooops, I mean Count(*)
    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.

  6. #6
    sherrygroves is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    23
    Can't get the Count(*) to work.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    What happens - wrong result, error?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  8. #8
    sherrygroves is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    23
    I figured it out and its working now. Thanks!!!

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Solved DCount(...) or Count(*)?
    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.

  10. #10
    sherrygroves is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    23
    I'm using Count(*). My problem was I had the Count text box in the page footer section instead of the report footer section. That is why none of the other count functions worked. My user prompts work as well. Thanks!!

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

Similar Threads

  1. Count(*) function
    By FJM in forum Access
    Replies: 18
    Last Post: 09-13-2013, 07:47 PM
  2. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  3. Replies: 5
    Last Post: 05-08-2012, 01:26 PM
  4. Replies: 1
    Last Post: 06-02-2010, 10:05 AM
  5. Count and recount for every new user per day?
    By valkyry in forum Queries
    Replies: 0
    Last Post: 07-24-2006, 03:37 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