Results 1 to 3 of 3
  1. #1
    dougdrex is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    49

    How to create a subtotal on a subform and display it on main form in Access 2010

    I am learning Access 2010, and am trying to build a database as part of my learning experience. The database I am building is one to track my family's budget/finances. I have a table called Transactions (parent) and another one called TransactionDetails (child). I have built a form (called FORM_ExpenseTransactions) with a subform (FORM_ExpenseTransactionDetails) to enter data into these fields. The subform can handle multiple expense categories for any transaction.

    What I'm trying to do is display a subtotal of the expense amount (subform field called "ExpenseAmount"). In the subform footer, I have created a textbox and entered, "=Sum([ExpenseAmount])" in the Control Source and named it, "TotalExpense".



    Then I created another textbox in the main form and entered, "=[FORM_ExpenseTransactionDetails].[Form]![TotalExpense]" in the Control Source.

    The textbox on the main form just says, "#Name?". What did I do wrong?

    I have attached a database with a handful of ficticious transactions if that would help.

    Thanks in advance for any words of wisdom from experienced Access gurus!
    Doug
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Next time try using the BUILDER. (the icon w magic wand and elipsis) This will guide you to the correct spelling and reference.

    but try
    =forms!form_ExpenseTransactionDetails].[Form]![TotalExpense]
    or
    =me.[Form]![TotalExpense]

  3. #3
    dougdrex is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    49
    Quote Originally Posted by ranman256 View Post
    Next time try using the BUILDER. (the icon w magic wand and elipsis) This will guide you to the correct spelling and reference.

    but try
    =forms!form_ExpenseTransactionDetails].[Form]![TotalExpense]
    or
    =me.[Form]![TotalExpense]
    Thank you so much for the prompt reply. I tried both of those in the textbox in the main form. But neither of them worked. I still have the same "#Name?" error.

    I'm wondering if the textbox in the subform needs to be corrected. The Control Source for that textbox reads, "=Sum([ExpenseAmount])". That's the only field I'm trying to total for the individual record.

    Feel free to review the Access file I attached earlier. The data has been properly scrubbed and it only contains sample data. It's entirely possible I've made some other error that might be causing it to not function properly.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-05-2014, 03:36 AM
  2. Replies: 1
    Last Post: 03-17-2014, 11:27 AM
  3. Replies: 3
    Last Post: 03-17-2014, 10:23 AM
  4. Create Subtotal in Access 2010 Query
    By alcharbonneau in forum Queries
    Replies: 8
    Last Post: 03-13-2013, 12:52 PM
  5. Replies: 4
    Last Post: 02-04-2012, 12:51 PM

Tags for this Thread

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