Calculating 2 fields in subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Accessnewb
    New Member
    • Feb 2008
    • 6

    Calculating 2 fields in subform

    I'm trying to calculate 2 seperate fields in a subform

    First one is TotalQuantity
    I have =Sum([Quantity]) in the subform footer
    I then show this total on the main form with =Windows.Form!T otalQuantity
    The above works no problem

    The Second one I calculate is TotalPrice
    I have =nz(Sum(ExtPric e)) in the subform footer
    I then show this total on the mian form with =Windows.Form!T otalPrice

    This doesn't work, I get an error on the main form.

    What also baffles me is once I add the calculations for the second field, the first one also gives me an error and no longer works. I've searched various resources for over an hour and can't figure it out. HELP me plpease =)
  • smorrison64
    New Member
    • Dec 2007
    • 7

    #2
    On the help page below, it appears that the syntax in your code may be incorrect for the Nz function. You shouldn't have a null value for an extended price. If the item has no cost, I would use 0.00 in that field and just use =sum([ExtPrice]).

    Comment

    • Accessnewb
      New Member
      • Feb 2008
      • 6

      #3
      I have tried that also. That doesn't work either. I am completely at a loss as to why this isn't working.

      Comment

      • smorrison64
        New Member
        • Dec 2007
        • 7

        #4
        Can you send me a copy of the database? << e-mail removed >>

        Originally posted by Accessnewb
        I have tried that also. That doesn't work either. I am completely at a loss as to why this isn't working.
        Last edited by NeoPa; Feb 21 '08, 02:46 PM. Reason: e-mail removed as per site rules

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32662

          #5
          Sherry,

          Please feel free to swap contact details via the PM system, but that is not allowed in the public forums. Sorry.
          See the Help (Link at top right) section for fuller details.

          -Admin.

          Comment

          • Accessnewb
            New Member
            • Feb 2008
            • 6

            #6
            I woke up this morning with a fresh mind and figured it out.
            Instead of having it sum the extprice, I had it calculate the sum of Price x quantity and it worked for some reason.

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32662

              #7
              That's good. Thanks for updating the thread :)

              Comment

              Working...