Results 1 to 3 of 3
  1. #1
    tareyj8569 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    43

    DCount Error

    Hey heys,
    I have a report I am trying to do with multiple DCounts that are on unbound Text Boxes. The DCounts work perfectly ...as long as I dont use date criteria.
    Example of DCount code =DCount("[Location]","TestQ","[Location] = 'Pink 1'")
    The Report looks at a query that has a date field which in the criteria if I had Between [Enter Start Date] AND [Enter End Date] it prompts the 2 but the fields will display #ERROR but without the between in the query works just fine. If I run query not the report the data pulls. Can someone please direct me in the right direction so user can type the between date and the dcounts will work without Error out. (Thought I was close)

    Thanks for your time and help as always!!

  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,771
    I never use dynamic parameter input popup in query, actually, never use dynamic parameters at all in query.

    I have criteria input into textboxes on form then refer to the textboxes. Either the query can reference the textboxes or the DLookup expression can.

    =DCount("[Location]","TestQ","[Location] = 'Pink 1' AND [date field] BETWEEN #" & [Forms]!formname].[tbxStart] & "# AND #" & [Forms]!formname].[tbxEnd] & "#")
    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
    tareyj8569 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    43
    Took me a few to set up correctly, but now that it is works like a charm.. thank you so much!

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

Similar Threads

  1. DCount error
    By azhar2006 in forum Forms
    Replies: 5
    Last Post: 09-13-2014, 03:58 AM
  2. DCount Error
    By drewetzel in forum Access
    Replies: 5
    Last Post: 02-13-2014, 06:57 AM
  3. Dcount Error
    By waqas in forum Queries
    Replies: 3
    Last Post: 07-28-2012, 08:24 PM
  4. DCount on a Query giving #Name? error
    By Huddle in forum Access
    Replies: 9
    Last Post: 06-20-2012, 11:40 AM
  5. Replies: 5
    Last Post: 12-15-2011, 11:16 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