Hi,
I’ve a combo box [TYPE] with two values to choose from (Primary & Secondary). Based on selection made from the dropdown, I would like to display the sum for the [Amount] field in my report.
If user makes no selections, [Amount] = the sum of both values (primary and secondary). And, if Amount is blank, I would like to display “n/a”
I tried the following:
a. if Primary is selected from dropdown, the sum is correct
b. if Secondary is selected from dropdown, the sum is correct
1. But, if nothing is selected from [TYPE] dropdown (i.e. type = Primary and secondary) I get an incorrect sum. For some reasons the amount for type = Secondary is being added twice.
2. How can I display a text message e.g. “N/A” or “No totals for this case” etc. when amount is blank?
I tried the following formula, but it didn’t work.
I use Access 2016.
TIA
Regards,
OCM
I’ve a combo box [TYPE] with two values to choose from (Primary & Secondary). Based on selection made from the dropdown, I would like to display the sum for the [Amount] field in my report.
If user makes no selections, [Amount] = the sum of both values (primary and secondary). And, if Amount is blank, I would like to display “n/a”
I tried the following:
Code:
=Sum(IIf([Amount] Is Null,0, [Amount]))
b. if Secondary is selected from dropdown, the sum is correct
1. But, if nothing is selected from [TYPE] dropdown (i.e. type = Primary and secondary) I get an incorrect sum. For some reasons the amount for type = Secondary is being added twice.
2. How can I display a text message e.g. “N/A” or “No totals for this case” etc. when amount is blank?
I tried the following formula, but it didn’t work.
Code:
=Sum(IIf([Amount] Is Null,”N/A”, [Amount]))
I use Access 2016.
TIA
Regards,
OCM