Search code examples
ms-accessvbaexpressionbuilder

In Access VBA expression builder, how do I sum a column conditionally?


Let's say I have two fields A and B and one textbox B_input. I would like to set up a query so it sums all entries of column A where B = B_input

Currently I have:

==Sum(IIf([B_input]<>"All",[A],IIf([B_input]<>[B],0,[A])))

I did more testing, it seem the problem is that under Sum(IIF([B_input])), it's not recognizing the value of [B_input], but if I just have IIF([B_input]), it recognize the value just fine, any ideas?


Solution

  • Gave up, went with form filtering instead.