# If THen Statement in Access Report

#### Nokose

##### New Member
I am working on a system and running short on time. I trying to get a piece of an invoice to work correctly here is the scenerio...

We will be holding a silent auction. Before this auction we will have a gambling event, half of the winnings for that can be applied to the silent auction. I have the winnings in the system under a table called winning. Now on the report I have the Silent Auction Totals coming up under a group called silent auction. How can I get the system to realize if they have won something under the silent auction then pull there winnings and divide that in half. If they do not have silent auction items it will not show winnings.

I have started with the function below:

=IIf([Group]="Silent Auction",[Winnings]/2,0)

However it is not reading correctly if there is even 1silent auction item on the invoice. It reads the first line which reads purchases and does not look for anything on the page to be Silent Auction.

Any help would be appreciated.

### Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Access doesn't calculate if any of the fields is Null (blank). To get around that, use the NZ() function to convert Null to zero --
=IIf([Group]="Silent Auction",NZ([Winnings])/2,0)

Denis

Replies
7
Views
1K
Replies
7
Views
1K
Replies
2
Views
209
Replies
1
Views
795
Replies
1
Views
397

1,221,212
Messages
6,158,558
Members
451,498
Latest member
tyshanklin1

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back