Results 1 to 4 of 4
  1. #1
    ozdemirozgur is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Posts
    2

    issues with DSum

    Hi,

    i am new to the access and need some help. I am trying to calculate a total using Dsum. I have two tables. the main table and the transactions. Both have the stockId. in addition, trasactions ahve transaction type and also year. I am calculating the total within a Do While statements

    Nz(DSum("TotalQuantity", "Combined_Annualized", "StockId=Main!sotkId and Trans = 'P' and Year ='2010'),0)

    I do not know why but the above statement does not work. please help

    tahnks, ozgur

  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,521
    I suppose this is part of your double nested loop thing? See if this helps:

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

  3. #3
    ozdemirozgur is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Posts
    2
    Hi Paul,

    My one is a bit different, I have a do while statement need to calcualte the total for a report. I have the following statement based consructed using the link you sent but the following did not work. Do you have nay idea what is wrong there?

    Main10_2000_Combined.OO_Rem_N_2001 = DSum("SALARY", "REM10_2000_Combined_Annualized", "COY_ID = " & Coy_Id1 _
    & " AND OO_Rem_Pos = '" & Pos & "'" _
    & " AND Rem_Year =#" & 2002 & "#")

    thanks

  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,521
    Year is probably a numeric field, so no delimiter around it, or if text you had it right to begin with. Since it's a fixed value, I wouldn't bother concatenating it. I would do it all on one line until you get it working; that way you're not debugging both line continuation issues and formula issues at the same time.
    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. Help with Sum and DSum
    By objNoob in forum Reports
    Replies: 5
    Last Post: 12-05-2011, 01:55 AM
  2. How do I use the DSum
    By Ironclaw in forum Access
    Replies: 1
    Last Post: 08-25-2010, 07:35 AM
  3. Help with dsum
    By bjsbrown in forum Reports
    Replies: 6
    Last Post: 02-06-2010, 09:33 AM
  4. DSUM HELP needed
    By jjmartinson in forum Access
    Replies: 0
    Last Post: 07-21-2009, 01:47 PM
  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