Results 1 to 5 of 5
  1. #1
    samuelitz is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2016
    Posts
    3

    Adding calculated text box to main form

    Hi guys,
    In my Orders Form (with Orders details sub-form), I'm tryin to add a text box that shows the final Amount to pay.


    Currently, this is the control source of the text box: =Sum([TblLink subForm].[Form]![Price]*[TblLink subForm].[Form]![amount])
    But it doesn't work! the text box is Empty. What can i Do?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    I would sum it in the Footer of the SubForm (which may not be visible but it is available). Then simply reference *that* textbox.

  3. #3
    samuelitz is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2016
    Posts
    3
    Thanks, it's working great. I'm wondering if there is a different way, more elegant, to do so...

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Hmm...it is the way I've always done it. I resist manipulating forms from other forms. Reaching in and getting results that form made I find elegant. Just my $0.02.

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Allan's suggestion is pretty much the accepted approach for this kind of thing. IMHO, doing math involving Fields displayed in a Form is better off being calculated in that Form, and then simply referencing it from another Form; you're simply pulling one piece of data from the original Form, rather than multiple pieces of data.

    Linq ;0)>

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

Similar Threads

  1. Replies: 1
    Last Post: 07-10-2015, 06:38 PM
  2. Replies: 6
    Last Post: 03-05-2015, 01:42 PM
  3. Adding subforms on a main form
    By ludovic_44 in forum Forms
    Replies: 14
    Last Post: 04-28-2014, 09:45 AM
  4. Replies: 1
    Last Post: 03-27-2014, 06:42 AM
  5. Replies: 4
    Last Post: 03-14-2012, 10:08 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