Results 1 to 5 of 5
  1. #1
    cope is offline Novice
    Windows 11 Office 365
    Join Date
    Jul 2025
    Posts
    2

    Question Summing a field not working.

    trying to sum a field called calculated downtime based on the date and line ID.


    I have the command for the default value of my text box as:

    DSum([Data].[Calculated Downtime], "Data", [date of incident] = "date in a textbox in this form" and [LineID] = "Line a")

    Keeps returning #NAME.
    any suggestions.

  2. #2
    cope is offline Novice
    Windows 11 Office 365
    Join Date
    Jul 2025
    Posts
    2
    Tried something different and using this in a query.
    Line1DT: DSum([Data].[Calculated Downtime],"Data",[Data].[DATE of Inncident] = [Log times and products].[LogDate])
    Says miss an , somewhere.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,927
    never seen a date with a value "date in a textbox in this form". Always help if you research how to use the functions - https://support.microsoft.com/en-us/office/dsum-function-08f8450e-3bf6-45e2-936f-386056e61a32

    provide the names of your controls in your form that you are referencing.

    but I would expect something like

    dsum("[calculated downtime]","Data","[date of incident] = #" & format(me.txtDate,"yyyy-mm-dd") & "# and LineID=" & me.txtLineID)



  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Also no need to prefix the fields with the source name. That is the second parameter in domain functions.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Can't use Me in textbox or query, only in VBA behind form or report.
    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.

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

Similar Threads

  1. Total Column Not Summing Fields
    By janmack79 in forum Queries
    Replies: 2
    Last Post: 02-12-2019, 03:46 PM
  2. Query Not Summing Correctly
    By cmumphr in forum Queries
    Replies: 4
    Last Post: 11-05-2018, 12:41 PM
  3. Replies: 2
    Last Post: 06-14-2016, 02:36 PM
  4. Summing Multiple Queries & Summing Time
    By WEJ in forum Queries
    Replies: 2
    Last Post: 10-04-2013, 04:46 PM
  5. Issue summing two field values
    By w2vijay in forum Reports
    Replies: 4
    Last Post: 02-10-2010, 01: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