Results 1 to 5 of 5
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Sum of Fields

    I know that in forms, I can just use a text field and add up numbers in other text fields. Reports seem to be different. I need to add up fields, but it won't use the code: =sum(txtFemale)+(txtMale) in the Control Source. I got that information from using the DLookup from some queries. So, I decided to use those queries and add them up with the DLookup: =Sum((DLookUp("SumOfSexCount","qryStatSexCombined4 ","Sex='Female'"))+(DLookUp("SumOfSexCount","qrySt atSexCombined4","Sex='Male'")))


    That just gave me an error.

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Have you looked at using dCount (or dSum depending on your query) instead of dLookup?

    Cheers,
    Vlad

  3. #3
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    I did not. I'm not familiar with the dSum. Can you give an example of it?

  4. #4
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    I guessed on it. I came up with: =DSum("SumOfSexCount","qryStatSexCombined4")
    It seems to work.

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Great, glad to hear! If you think this issue is now solved please mark it accordingly.

    Cheers,
    Vlad

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

Similar Threads

  1. Replies: 3
    Last Post: 12-02-2017, 02:04 PM
  2. Replies: 2
    Last Post: 11-27-2017, 08:59 PM
  3. Replies: 3
    Last Post: 04-24-2016, 07:24 AM
  4. Replies: 8
    Last Post: 08-02-2012, 10:50 AM
  5. Replies: 12
    Last Post: 05-07-2012, 12:41 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