Results 1 to 6 of 6
  1. #1
    ksor's Avatar
    ksor is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Feb 2017
    Posts
    126

    Is DCount() counting wrong ?


    I have a table with a field on each record containing path's til files on my disk.

    I wants to know if more than 1 record "points" to a file I want to delete - so I use the DCount() but it counts wrong !!!!

    In my immidiate window I do a DCount() for a specific filepath - and it SHOULD return 2 (the last 2 in the table !), but it returns 5 - see my attachment !

    What it wrong here ?
    Attached Thumbnails Attached Thumbnails DCountError.jpg  

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Is [pinpointer] field a memo field?
    you can't query on memo fields.

  3. #3
    ksor's Avatar
    ksor is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Feb 2017
    Posts
    126
    Quote Originally Posted by ranman256 View Post
    Is [pinpointer] field a memo field?
    you can't query on memo fields.
    No, it's a text-field

  4. #4
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Is my eyesight going or is the name of your field different in your Dcount from in your table

  5. #5
    AccessPower's Avatar
    AccessPower is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    165
    Your eyesight isn't wrong. one has underscores, the other has spaces.

  6. #6
    ksor's Avatar
    ksor is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Feb 2017
    Posts
    126
    Quote Originally Posted by andy49 View Post
    Is my eyesight going or is the name of your field different in your Dcount from in your table
    That part MSAccess maneges itself - I did NOTHING when typing the names ... I think it's called "intellisense" ... it presents the names itself - right ?

    EDIT:

    But in the criteria section I have to use the actual field name NOT the access interpretation of it !

    I have changed the code so the field ONLY contains the file NAME, path NOT included !

    This here counts right :

    ? DCount("*", "STED","[Sti til PinPointer-fil] = 'Hasle Sogn.kmz'")
    2

    NICE !
    Last edited by ksor; 02-08-2017 at 12:39 PM.

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

Similar Threads

  1. DCount() not counting?
    By sleptema in forum Programming
    Replies: 4
    Last Post: 07-04-2013, 06:27 PM
  2. DCount
    By Newbie11 in forum Reports
    Replies: 4
    Last Post: 08-03-2012, 12:23 AM
  3. DCount
    By Ray67 in forum Queries
    Replies: 2
    Last Post: 06-26-2012, 10:48 AM
  4. DCount
    By nsteenhaut in forum Queries
    Replies: 2
    Last Post: 10-04-2011, 05:00 PM
  5. DCount only counting some dates
    By Jules48 in forum Programming
    Replies: 7
    Last Post: 09-22-2011, 02:29 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