5

I have a question about using an IIF statement with a Yes/No field. In my case, I am trying to get the statement do one thing if the Yes/No field=Yes and another if it is "No." I realize Access stores the Yes/No field as -1,0 and have attempted to formulate the statement this way.

I did make this statement:

NetDonation: IIf([PickupRequired]-1,[DonationValue]-8.75, 0, [DonationValue])

Unfortunately, this statement does not differentiate between the PickupRequired field being "No" or "Yes" and it subtracts 8.75 from all values regardless if the PickupRequired field = No.

HansUp
  • 95,961
  • 11
  • 77
  • 135
user3185924
  • 51
  • 1
  • 2
  • 6

1 Answers1

5

IIf() will recognize Yes/No fields as True or False without your having to specify a numeric value, so the following will work just fine

IIf([PickupRequired], "The value is Yes", "The value is No")

In your particular case I suspect that you want

NetDonation: [DonationValue] - IIf([PickupRequired], 8.75, 0)
Gord Thompson
  • 116,920
  • 32
  • 215
  • 418