Results 1 to 3 of 3
  1. #1
    DannyV is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    5

    Help with calculated controls


    Hello! I've been trying to get this to work for a while now. I'm trying to add calculated controls to my main form and subform but it seems to not want to give me the actual numbers I'm wanting it just gives me "#ERROR". This is what I did: On my subform in design view I added two text boxes with the text box tool. So, on one of them I gave it the name (in the property sheet) txtInvoiceAmtSum then I went to the Control Source and typed in =Sum(InvoiceAmt). For the other text box I gave it a name of txtInvoiceNumCount and set the Control Source property value to =Count(InvoiceNum), then I exited the "Subform in new window" window and went back to design view on my main form. I added two text boxes on my main form as well. On the first one I named it "Number of Invoices:" then I went to the expression builder and typed in this code "=[frmInvoiceSubform].Form![txtInvoiceNumCount]". On the other one I created on the main form I called it "Invoice Amount Total:" and went into the expression builder and typed in "=[frmInvoiceSubform].Form![txtInvoiceAmtSum]. After I did that I went back to layout view and it seems the code didn't work because it's showing me "#ERROR" on each of the boxes. Can anyone help me out with this? I'd really appreciate it. Thanks!

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    This is What I want you to check the =[frmInvoiceSubform].Form![txtInvoiceNumCount]

    The Name marked in red has to be the name of the subForm control on the main form and not the name of the form that you may be using as a subform. To Check this out select the subform on the mainform. go to Subform/SubReport Properties and Check out the name of your SubForm Control.


    if this solves your problem mark this thread solved.

    refer attached screen shot

  3. #3
    DannyV is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    5
    Quote Originally Posted by maximus View Post
    This is What I want you to check the =[frmInvoiceSubform].Form![txtInvoiceNumCount]

    The Name marked in red has to be the name of the subForm control on the main form and not the name of the form that you may be using as a subform. To Check this out select the subform on the mainform. go to Subform/SubReport Properties and Check out the name of your SubForm Control.


    if this solves your problem mark this thread solved.

    refer attached screen shot
    OK, I checked and both the name and the source object are labeled as frmInvoiceSubform. So I believe that's what it should be at right? But it's still not working for me.

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

Similar Threads

  1. calendar controls
    By kganomega in forum Access
    Replies: 0
    Last Post: 12-16-2009, 12:34 PM
  2. subform controls hidden
    By bkelly in forum Forms
    Replies: 0
    Last Post: 09-26-2009, 10:12 AM
  3. Accessing form controls
    By dante in forum Forms
    Replies: 15
    Last Post: 07-28-2009, 08:26 AM
  4. Referring to fields in tab controls
    By AndrewAfresh in forum Forms
    Replies: 1
    Last Post: 06-03-2006, 05:10 PM
  5. Adding Controls to a Form
    By msmayhew in forum Programming
    Replies: 7
    Last Post: 12-14-2005, 03:26 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