#Error on Sum Formula from Subform

G

Guest

Hello, I have this formula on the subform =IIf([PICK]=True,Nz([DUE SHIP]),0).
Now, on the main form, I want to sum the result of this condition. I keep
getting a #Error, helpppppppppppppp! Thanks all.
 
S

Steve Schapel

Javy,

You didn't mention how you are going about getting the sum of this
calculated control onto your main form. But I think you will need to do
the sum in a control in the Header or Footer of the subform, and then
reference *that* control on the main form. In other words, let's say
you put a TotalWhatever textbox on the subform, with its Control Source
like this...
=Sum(IIf([PICK],Nz([DUE SHIP],0),0))
.... and then, the control on your main form like this...
=[NameOfSubform]![TotalWhatever]

If you still need more help, please give some more details of what
you've got there.
 
G

Guest

Good Question, Pick is a Yes/No field

KARL DEWEY said:
What kind on field is [PICK]?

JavyD said:
Hello, I have this formula on the subform =IIf([PICK]=True,Nz([DUE SHIP]),0).
Now, on the main form, I want to sum the result of this condition. I keep
getting a #Error, helpppppppppppppp! Thanks all.
 
G

Guest

Ok, on the mainform I have the subform, what this subform has is order
numbers and products on that order. Some I want to ship and some I dont.
What I have is a checkbox for each line on the order, that when checked, it
means that I want it to ship. What I want, is this control to not sum, but
to just populate in the instance that that specific item will be picked, else
stay at 0.

Now on the main form which has a link to the subform by PO number. I want to
add all of the ship qty by line on that order that will being shipped.

Is that a better explanation?

Steve Schapel said:
Javy,

You didn't mention how you are going about getting the sum of this
calculated control onto your main form. But I think you will need to do
the sum in a control in the Header or Footer of the subform, and then
reference *that* control on the main form. In other words, let's say
you put a TotalWhatever textbox on the subform, with its Control Source
like this...
=Sum(IIf([PICK],Nz([DUE SHIP],0),0))
.... and then, the control on your main form like this...
=[NameOfSubform]![TotalWhatever]

If you still need more help, please give some more details of what
you've got there.

--
Steve Schapel, Microsoft Access MVP

Hello, I have this formula on the subform =IIf([PICK]=True,Nz([DUE SHIP]),0).
Now, on the main form, I want to sum the result of this condition. I keep
getting a #Error, helpppppppppppppp! Thanks all.
 
S

Steve Schapel

Javy,

Did you try the idea that I suggested before? Did it not do what you
wanted? If not, I think I understand your explanation, but not how it
relates to your original question. Try giving an example. Example
means actual data from your form, and expected results in specific
numbers. Thanks.
 
G

Guest

It's ok Steve, thanks for your help, I think you answered this already in
another post. I just placed the expression in the query, then the sum
control in the footer of the subform, then on the form I did the reference to
the subform, worked fantastic. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top