Results 1 to 5 of 5
  1. #1
    Benj is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    33

    Dsum newbie

    I couldnt figure why the result shows #Name for the field. Its an unbound field =DSum("ptot","qrypiglet","PrimKeys = '" & [Me].[Parent]![PrimKey] & "'")
    where ptot: IIf(IsNull([Reason]=True),[PigNum],[PigNum]*-1)


    PrimKeys is the child linked to the PrimKey (parent)

    thanks!

  2. #2
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    The error message had to be "Invalid use of Me keyword".

    Remove the [Me]. from the [Me].[Parent]![PrimKey] and will work as you expect.

    Also, change the IIf(IsNull([Reason]=True), to IIf(IsNull([Reason])=True, or to the simplest IIf(IsNull([Reason]),

  3. #3
    Benj is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    33
    Hi accesstos! I already removed the [Me] but it now shows Error. My old file doesnt have a [Me] on it and it worked. But before my primary key is not autonumber, i have to enter a text (as a primary key). I was told that its not a good idea to do that so I added a new primary key which was PrimKey for parent and Primkeys for the child. Not sure where i screwed up. Thanks so much!

  4. #4
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Hi Benj!
    It seems that you are doing more steps than you need.
    If subform (child) is bound to qrypiglet put your unbound text box in form footer of subform with the expression: =SUM([ptot])

    You welcome!

  5. #5
    Benj is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    33
    Quote Originally Posted by accesstos View Post
    hi benj!
    It seems that you are doing more steps than you need.
    If subform (child) is bound to qrypiglet put your unbound text box in form footer of subform with the expression: =sum([ptot])

    you welcome!
    thank you so much! Its working now

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

Similar Threads

  1. DSum
    By GuyfromDet in forum Access
    Replies: 1
    Last Post: 02-24-2017, 11:43 AM
  2. Dsum
    By doddiah in forum Access
    Replies: 5
    Last Post: 07-20-2015, 02:56 PM
  3. Dsum Help?
    By Ragin_roider in forum Queries
    Replies: 5
    Last Post: 03-19-2012, 03:10 PM
  4. Help with Sum and DSum
    By objNoob in forum Reports
    Replies: 5
    Last Post: 12-05-2011, 01:55 AM
  5. How do I use the DSum
    By Ironclaw in forum Access
    Replies: 1
    Last Post: 08-25-2010, 07:35 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