Results 1 to 8 of 8
  1. #1
    ortizimo is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2017
    Location
    FL
    Posts
    88

    Displaying a SUM from one form into another form

    One table has a sum that I want to display into a form not of that table if that makes sense. I'm using this which errors out:



    =Sum([tbl_Commission].[Commissions])

    also used:
    =DLookUp(=Sum([tbl_Commission].[Commissions]))

    Again, trying to display a total SUM from a form into another form.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Presuming the first form is open, simply refer to the control:

    =Forms!FormName.TextboxName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ortizimo is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2017
    Location
    FL
    Posts
    88
    Quote Originally Posted by pbaldy View Post
    Presuming the first form is open, simply refer to the control:

    =Forms!FormName.TextboxName
    and if its not, how can i pull the info from the tbl or qry into a form?

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    One way would be a DSum() with the same source, or an appropriate criteria.

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

  5. #5
    ortizimo is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2017
    Location
    FL
    Posts
    88
    Quote Originally Posted by pbaldy View Post
    One way would be a DSum() with the same source, or an appropriate criteria.

    DLookup Usage Samples
    This is what i tried which did not work:
    DLookup("txtIncome", "tbl_Commissions", "Sum = " & forms!frm_Commission!txtIncome)

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is txtIncome the name of the field in the table you want summed? It needs to be. Also, "Sum" needs to be the field you want the criteria applied to, and the form reference would refer to a control containing the value to filter on.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    ortizimo is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2017
    Location
    FL
    Posts
    88
    Quote Originally Posted by pbaldy View Post
    Is txtIncome the name of the field in the table you want summed? It needs to be. Also, "Sum" needs to be the field you want the criteria applied to, and the form reference would refer to a control containing the value to filter on.
    yes it is the name of the field in a form...could you use my code above and correct it? thnx.

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Let's clarify. Forms have controls (textboxes, combos, etc); tables have fields. In the first argument, you want the name of the field in the table, not the name of a textbox on a form. Did you study the link I posted?
    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. Replies: 10
    Last Post: 07-04-2015, 02:55 PM
  2. Replies: 3
    Last Post: 08-26-2014, 12:52 PM
  3. Replies: 10
    Last Post: 10-14-2013, 10:18 AM
  4. Replies: 1
    Last Post: 11-12-2010, 06:33 PM
  5. Replies: 1
    Last Post: 11-07-2010, 11:04 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