Results 1 to 4 of 4
  1. #1
    Tuckejam is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2020
    Posts
    168

    Help with Dlookup or maybe Dsum

    still struggling to understand how to use these. I even have them in other parts of my database the others have helped me with and I have spent a fair amount of time playing with it trying to understand and get them to work with this but no luck.

    Seems simple enough

    I Have a form, and it has a subform and the subform gets it data from a query.

    in the query there are some calculated/expression fields



    "PastDue = DuesOwed - DuesPaid" and "FinesPastDue = FinesOwed - FinesPaid" And Finally "TotalDue = PastDue + PastDueFines"
    (that is oversimplified for the sake o explaining, I do have the expressions correct in the qry fields)

    Now I need the sum of all of the numbers in the "TotalDue" column

    And I need that to display in the Main form not the subform.

    apologies for the artwork below
    Click image for larger version. 

Name:	Capture.jpg 
Views:	16 
Size:	120.3 KB 
ID:	45228

    As always thank you for the help

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Maybe try the following in the control source of the that textbox: =dSum("[TotalDue]","[qry_ChptDuesTrack]")

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    in a summation query , put SUM where the EXPRESSION is. (but that way works too)

    DSUM & Dlookup are used in a text box. (not a query) =Dlookup("[Fld2Return]","qry/tbl",sWhere)
    , where sWhere ="[field]='" & txtBox & "'"

    Since your query already does the SUM, then you can just run a:
    Dlookup("[TotalDue]","qry","[ClientID]=" & txtID)

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    If this is a form/subform setup then you don’t need the domain function

    In the subform footer put a text box with a control source of

    =sum(totaldue)

    Call the textbox say txttotal

    You can the hide the control and on the main form have a textbox with a controlsource of

    =nameofsubform.form.txttotal

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

Similar Threads

  1. Access Dlookup of a Dlookup Assistance
    By caper in forum Access
    Replies: 3
    Last Post: 08-27-2020, 05:56 PM
  2. Dsum help
    By messier in forum Queries
    Replies: 2
    Last Post: 05-15-2020, 12:30 PM
  3. DSUM with DLOOKUP
    By maxmaggot in forum Forms
    Replies: 1
    Last Post: 03-31-2013, 04:48 PM
  4. How do I use the DSum
    By Ironclaw in forum Access
    Replies: 1
    Last Post: 08-25-2010, 07:35 AM
  5. Help with dsum
    By bjsbrown in forum Reports
    Replies: 6
    Last Post: 02-06-2010, 09:33 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