Results 1 to 4 of 4
  1. #1
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186

    Sum operation into a Form linked with Subform

    Hello everyone,



    I have a question.

    How to perform a sum operation into a form linked with a subform?

    I have into a form named Main_form a textbox field named "Me.Code_Id" and also into this form a subform named "Subform1".

    Into Subform1 there is a textbox field named "Code" and a second one named "Price"

    Both forms are linked with the fields "Me.Code_Id" as Master and Code as Child



    Into the form named "Main_Form" there is a field named "Total" and what I want to do is that in total will be shown the sum of the prices of each record from "Subform1" where Code = Me.Code_Id

    Can somebody help me with the sequence that should be introduced into the field?


    Thanks so much for the support!!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Is the subform in datasheet or continuous view?

    One approach:

    Create a textbox in subform footer that has expression: =Sum([Price])

    Another textbox in main form can reference the subform textbox: = [subformcontainer name].Form.textboxname
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186
    Hi!

    This is in continuous view.

    I had some issues with the textbox into the main form, I added the textbox but I had some issues with the sequence


    Me.Totaltxt =[Forms].[Main_Form].[Subform1].[Price]

    How should be it fixed?

    Thanks for the support!!!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Per my example.

    Subform textbox: =Sum([Price])

    Main form textbox: =[Subform1].Form.[textbox name]
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 11-04-2012, 09:25 AM
  2. Form and Subform not linked
    By Marianna_Air in forum Forms
    Replies: 4
    Last Post: 08-13-2012, 09:35 AM
  3. Combobox control for linked form/subform
    By Dbusse706 in forum Access
    Replies: 2
    Last Post: 07-03-2012, 07:49 PM
  4. Replies: 4
    Last Post: 03-01-2012, 08:15 PM
  5. Replies: 3
    Last Post: 02-05-2010, 10:10 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