Results 1 to 4 of 4
  1. #1
    83dons is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    15

    DCOUNT issues

    Hi I have a form that is linked to a query by its Record Source.



    In one of the Text boxes I want to appear the number of rows in the query where Days = 4 so I thought I would try to use DCOUNT as the Control Source for the Text Box. However every expression I try for DCOUNT throws back error? or name?. Any ideas if this can work and how to sort my code? Iv tried all manner of brackets, apostraphes and inverted commas!

    =DCount("[EPISODEUNIQUEKEY]","1-12 Show Records by Date Range","[Days] = '4'")

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    The table/qry part, if it has spaces, must have brackets around the name.

  3. #3
    83dons is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Posts
    15
    I have tried that and no success. I think the problem is that the original query requires start and end date parameters entered when the form opens so maybe DCOUNT will not work...Another solution probably required!

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    It is difficult for readers to guess at what you want in detail. As has been said, any names with embedded spaces require a leading [ and a trailing ] (that's what access needs for syntax)
    We know nothing about your tables or fields, or even the details of the issue. Can you tell us in plain English?
    Can you post a screen capture of your tables and relationships (relationships window).

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

Similar Threads

  1. DCount
    By Newbie11 in forum Reports
    Replies: 4
    Last Post: 08-03-2012, 12:23 AM
  2. DCount
    By Ray67 in forum Queries
    Replies: 2
    Last Post: 06-26-2012, 10:48 AM
  3. DCount and If
    By Madmax in forum Access
    Replies: 3
    Last Post: 07-28-2011, 06:53 AM
  4. DCount and SQL
    By DSTR3 in forum Queries
    Replies: 3
    Last Post: 12-06-2010, 03:07 PM
  5. Help with Dcount
    By tozey in forum Programming
    Replies: 1
    Last Post: 08-10-2010, 10:53 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