Results 1 to 3 of 3
  1. #1
    estergr is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2022
    Posts
    10

    Dsum total depending on combobox field

    Hi everyone, I am not a big expert of access, so I ask for your help on this matter I have tried to solve for days.

    As I work in cancer research field, any expense is attributed to a project (called Grant). As you can see on the picture attached I have a table summarizing the financial details of a project.

    Now what I would like is to show the sum of the expenses in the field circled (SPESO), but only the expenses attributed to the project selected in the combobox IDGrant and the Annuality selected in the combobox IDAnnualita

    In the field "SPESO" I wrote this code

    =DSum("Importo";"SpeseGrantT";"IDVoceSpesa=1")

    which works fine returning only the category of expense I need (I have several) but to this code I need to add something so that, it will sum only the expenses of the project selected in IDGrant and IDAnnualita.

    I ve read around and tried but didn't come up with the right solution.





    Click image for larger version. 

Name:	dettagli.jpg 
Views:	10 
Size:	65.6 KB 
ID:	47265

    Hope you can help. Thanks

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,943
    You use those fields in the criteria as well?

    Strings need to be surrounded by single quotes ' unless it contains a single quote, then triple double quotes works, I think?

    Dates with # and in mm/dd/yyyy or yyyy-mm-dd format

    Numbers do not need anything
    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

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    You didn't provide field names that the combos are bound to, so research 'ms access dsum with multiple form criteria' or look at the similar posts links at the bottom of your thread or look here
    https://www.accessforums.net/showthread.php?t=64378

    Post samples of what you tried if you're still stuck.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. DSUM Running total by group
    By chowing0823 in forum Access
    Replies: 10
    Last Post: 10-07-2022, 03:15 AM
  2. Replies: 4
    Last Post: 06-11-2021, 01:42 PM
  3. Replies: 6
    Last Post: 03-27-2017, 03:16 AM
  4. Using dsum to return a cumulative total
    By tomnsd in forum Queries
    Replies: 7
    Last Post: 04-01-2013, 01:16 PM
  5. Replies: 3
    Last Post: 09-06-2012, 03:35 PM

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