• Calculated Field on Sub form (2003 All Updates)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Calculated Field on Sub form (2003 All Updates)

    Author
    Topic
    #444892

    I have a sub form which has data such as cost and quantity. I want to calculate the total for the individual line so have used the =Form.SubFormname.fieldname process eg multiply the quantity by the costs with mixed results
    When I open the subform (which gets its info from a table not a query in case thats important), everything works fine. When I open the parent form I get NAME? instead of the calculated result in the subform
    I tried adding the parent form and subform names as the source to ensure the full “path” was there eg =Form.parentformname.subformname.fieldname but got nowhere.
    What am I doing wrong
    Steve

    Viewing 1 reply thread
    Author
    Replies
    • #1077107

      Use an expression like this:

      =[Subformname]![Controlname]

      or

      =[Subformname].[Form]![Controlname]

      where Subformname is the name of the subform as a control on the main form. This is not necessarily the same as the name of the subform in the database window. To see the control name, open the main form in design view and click once on the subform. The control name will be displayed in the title bar of the Properties window.

    • #1077109

      You can’t use the =Form.SubFormname.fieldname syntax when the form is open as a subform.
      You either need to use the full syntax you tried , or just the simpler one that just uses field names.
      e.g. [Quantity]*[Price]

      Or perform the calculation in a query, and bind the control to the calculated field from the query.

    Viewing 1 reply thread
    Reply To: Calculated Field on Sub form (2003 All Updates)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: