Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2008
    Posts
    8

    Unanswered: An old topic over again I guess

    Hello all
    I know this has been covered before and I have endeavoured to do whatever suggestions were made but somewhere along the line I just 'don't get it'. Sorry to ask again.

    I am trying to get the subform to have a running total.

    I have a form - frmTransactionEntry. This form has ONLY 1 FIELD (Text16 mentioned below) - the rest is only text etc.

    Inside that form is a subform - frmTransactionsListing. This forms fields are from the tblTransactionsListing table.

    I have no query on/in the subform.

    In the footer of the subform I have put a text box - Text20 with the control =sum(Amount). Amount is one of the fields on my subform. In the details section of the main form I have a text box - Text16. I have put a million different bits in that text box but continually get either a #name or a #error message when I change to form view.

    I know 100% that the subform is adding correctly because I have entered one row of data, changed the subform to form view and I can see it quite easily. I can go back to datasheet and enter another row and when I go back to subform formview the total has changed correctly.

    This is the code I have been playing with for the main form text box.

    =[frmTransactionsListing subform].Form!Text20

    Has anyone got any ideas why it might not be working please. I would really appreciate it.

    Thanks so much

    Dai

  2. #2
    Join Date
    May 2008
    Location
    Raleigh, NC
    Posts
    151

    Here is a suggestion....

    I tried to follow your logic and set up a subform linked to a simple table. I put one field on a form and then added the subform. The subform contains text1, text2, and text3 with text20 in the bottom with its control source set to "=[text1]+[text2]+[text3]". This works fine on the subform. I then probably tried what you have done and kept getting the #name and similar stupid errors so I tried this;

    In the properties box of text16 (on the main form) click on the expression builder and the window will pop up. Your form should be listed 1st on the left, open it up and click on the subform and then on text20. This should put something like the following string;

    =[Your Subform Name].Form!Text20

    If this doesn't work there is another approach, but lets see if this doesn't do the trick.

    :-)Stu
    --If its free, take it for what its worth!

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    =NameOfSubformControl.Form!TotallingControlName
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    May 2008
    Location
    Raleigh, NC
    Posts
    151

    Great minds so think alike!

    Thanks for the validation!

    Quote Originally Posted by StarTrekker
    =NameOfSubformControl.Form!TotallingControlName
    --If its free, take it for what its worth!

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Well almost confirmation! You refer to the name of the subform, not necessarily the name of the control the subform is in



    BTW, you can get this by using the BUILD button (the three dots) and tracing your way to the subform then the control name
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Jul 2008
    Posts
    8

    Mwaaaaahhhhhhhhhhhhhhhh

    I love you guys Stu and Star Trek
    It's so nice to have so many helpful people on the net. You are two of them.
    It's given me another problem to work on though......lol
    Thanks a bunch guys.
    Daisy

  7. #7
    Join Date
    May 2008
    Location
    Raleigh, NC
    Posts
    151

    Aw shucks.....

    You make a me blush!

    Stu
    --If its free, take it for what its worth!

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    ^^

    You're most welcome Daisy
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •