Sum(IIf()) Help

G

Guest

=Sum(IIf([OrderDetails Subform].[Description] Like "Deilvery" Or
[OrderDetails Subform].[Description] Like "Carriage",[OrderDetails
Subform].[ExtendedPrice],0))

I'd like to sum the field ExtendedPrice when the field Description contains
"Delivery" OR "Carriage". Both fields are in the subform [OrderDetails
Subform]. The above code was entered as the control source for a text box on
the main form. #Error is displayed when the form is opened.

Any ideas where I've gone wrong?

Thanks

Dave
 
G

Guest

Try using

=Sum(IIf(Forms![NameOfMainForm]![OrderDetails Subform].Form![Description]
Like "Deilvery" Or Forms![NameOfMainForm]![OrderDetails
Subform].Form![Description] Like
"Carriage",Forms![NameOfMainForm]![OrderDetails
Subform].Form![ExtendedPrice],0))

Hope this helps.
 

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