Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2015
    Posts
    12

    Calculations (multiple subforms)

    Hi All,



    Thanks again in advance for answering my question.

    Background:
    1. The main form is called "Cost Card" and in this form I have a subform called "frmServings." It contains a textbox where the user can add a numerical number it's reference is "Text54" the Control Source Name is: "#1 SERVINGS"
    2. I have another subform within the the "Cost Card" called "Cost Card Subform."
    3. In the "Cost Card Subform" I have a couple of field records a) The Control Source Name is: "INPUT" and it's reference is "Text57." b) The last field record in the "Cost Card Subform" that I will be using is called "LANDED COST." a) The Control Source Name is a sum calculation of a couple of fields within the Cost Card Subform: "=[Text49]+[Text57]" and it's reference is "Text63."

    Problem:
    I have a textbox field called "COST / #1 ITEM" that I want to put the above information together and calculate.
    This is what I have entered by it returns an error "#NAME?"
    =([Text57]/(1000)*[Text63])*([frmServings].[Form]![#1 SERVINGS])

    Hopefully I can get some help on this because I can't seem to figure it out. THANKS!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I would start by adding a couple more unbound textbox controls and breaking up the various expressions into each of the unbound textbox controls.

    =[Text57]/(1000)

    =[Text57]/(1000)*[Text63]

    =[frmServings].[Form]![#1 SERVINGS]

    Your issue may be with your lack of a naming convention for your fields and other objects. For example, you do not want to include special characters like # in names of objects. Using the brackets ([]) can help, but brackets do not always provide a solution.

  3. #3
    Join Date
    Nov 2015
    Posts
    12
    Thanks for your help. I changed the #1 SERVINGS to Servings 1.

    There is still something wrong with =[frmServings].[Form]![Servings 1] and =[frmServings].[Form]![Text54]

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Believe it or not, white space is also considered to be a special character. It may not be as bad as using a double quote or a forward slash, but I would prefer Servings1 over Servings 1.

    Looking at one of your issues at a time, it seems you need to identify the name of a SubForm control. The following is looking for a subform control named, "frmServings".

    =[frmServings].[Form]![Servings 1]

    The control is the thing that acts as a Container for your form Object. Your form object and the Subform control can have the same name or they can have different names. To determine the name of a Subform control, select the control by using a Left Click and swooping your subform. The idea is you want to select the control, not the form object contained within the control and then look in the Property Sheet under the Other tab for the control's name.

    If the names are correct I would try
    =[frmServings].[Form].[ControlName]

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

Similar Threads

  1. Replies: 1
    Last Post: 02-13-2014, 01:50 AM
  2. Replies: 1
    Last Post: 09-20-2011, 07:28 PM
  3. Calculations with a multiple value field
    By ashwin09 in forum Forms
    Replies: 12
    Last Post: 07-31-2011, 11:22 AM
  4. Replies: 0
    Last Post: 04-25-2011, 04:11 AM
  5. Replies: 22
    Last Post: 03-15-2011, 07:17 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