Results 1 to 4 of 4
  1. #1
    Ganymede is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    100

    Dsum Problems

    I'm currently using a DSum formula on a form that functions correctly. It appears as:

    Code:
    DSum("Amount","InformalInquiriesSubform","Key = [Text2020]")
    I want to use the same function to obtain the same data in a query expression. However, instead of using Text2020, I want to reference the field that Text2020 represents. I would think that would look like this.

    Code:
    DSum("Amount","InformalInquiriesSubform","Key = [Key]")
    Unfortunately, access doesn't recognize this criteria. It simply returns the sum of all "Amounts" on the "Informal Inquiries Subform." I imagine the problem is that there is a different method for entering criteria when using a field from a table as opposed to a textbox on a form. I'm trying to figure out what that is.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Concatenate the value, like here:

    DLookup Usage Samples
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Ganymede is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    100
    That did it. Thanks.

    Code:
    DSum("Amount","InformalInquiriesSubform","Key = " & [Key])

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Dsum Help?
    By Ragin_roider in forum Queries
    Replies: 5
    Last Post: 03-19-2012, 03:10 PM
  2. Problems with DSum
    By Jackie in forum Access
    Replies: 1
    Last Post: 03-27-2011, 05:21 PM
  3. How do I use the DSum
    By Ironclaw in forum Access
    Replies: 1
    Last Post: 08-25-2010, 07:35 AM
  4. Help with dsum
    By bjsbrown in forum Reports
    Replies: 6
    Last Post: 02-06-2010, 09:33 AM
  5. DSUM Problems
    By swampdonkey in forum Forms
    Replies: 2
    Last Post: 09-29-2006, 10:52 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