Results 1 to 4 of 4
  1. #1
    Demerit's Avatar
    Demerit is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    125

    Display total as user enters sales data in a form

    I have a form named "FrmSales" which includes a subform named "InvoiceDetailsSubform"
    In the subfom, I have the following cotrols: Productname, Unit, Qty, UnitPrice, OUP and Amount.



    On the form sales I wish to have a control that displays the total of the control "Amount" as the user enters the sales data.

    What i did is: I created a control on the form footer of the form "FrmSales" and in the control, I attached the code

    =Sum([Forms.FrmSales.InvoiceDetailsSubform.Form.Amount])

    But when i return to Form view, I get an error display in the control.
    Please what is not correct with what i have done?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    What I think you need is this:
    A text box (lets name this txtSubFrmTotal) in the footer of the sub form with its Control Source set to:
    = Sum([Amount])
    Another text box on the main form (lets name this txtMainFrmTotal) with its Control Source set to:
    = [InvoiceDetailsSubform].Form!txtSubFrmTotal
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Demerit's Avatar
    Demerit is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    125
    Thanks Bob Frtz its working. In the parent form i actually used this

    =[Forms].[FrmSales].[InvoiceDetailsSubform].[Form].[TxtSubformTotal]

    in the control named TxtMainFrmTotal.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Alternatives

    1. subform set for datasheet view, open the form/subform normally (not in Design view), click on the subform then click the Totals button on ribbon to reveal a Totals row below last row

    2. subform in continuous view and arrange controls to look like datasheet, textbox in subform footer will now show
    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: 1
    Last Post: 11-30-2012, 02:04 PM
  2. Display Total on a form
    By Ray67 in forum Forms
    Replies: 21
    Last Post: 06-18-2012, 03:49 PM
  3. Replies: 0
    Last Post: 12-14-2010, 01:18 PM
  4. Replies: 9
    Last Post: 03-24-2009, 09:19 PM
  5. computing total sales per day using query
    By joms222 in forum Queries
    Replies: 0
    Last Post: 03-09-2009, 10:58 PM

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