# Report If/Then Statement in Report Footer

1. Novice
Windows 10 Office 365
Join Date
Jul 2020
Posts
2

## Report If/Then Statement in Report Footer

Hi, all. I'm hoping you can give me some guidance. I have a field in the Report Footer, [orride1] in which I'm trying to achieve the following: If the sum of [orride] is less than 0 (or 1, doesn't matter to me, however i can get it to work), then show it. If not, then show "0.00". I have a separate field doing "=Sum([orride]) and named it "orride1".

This is how I have the field reading: =Iff([orride1])<0,([orride1]), "0.00)

When I look at the report, the field [orride1] shows the expected results (-90000.00), but the calculation does not. I'm assuming there's something wrong in my calculation, but I can't see it.

Can any of you please help?

Thanks,
Penny

2. Access Developer
Windows 10 Access 2016
Join Date
May 2011
Location
Essex UK
Posts
2,519
Originally Posted by Pennypinscher
Hi, all. I'm hoping you can give me some guidance. I have a field in the Report Footer, [orride1] in which I'm trying to achieve the following: If the sum of [orride] is less than 0 (or 1, doesn't matter to me, however i can get it to work), then show it. If not, then show "0.00". I have a separate field doing "=Sum([orride]) and named it "orride1".

This is how I have the field reading: =Iff([orride1])<0,([orride1]), "0.00)

When I look at the report, the field [orride1] shows the expected results (-90000.00), but the calculation does not. I'm assuming there's something wrong in my calculation, but I can't see it.

Can any of you please help?

Thanks,
Penny
Try:
=Iff([orride1])<0,([orride1]), "0.00​")

3. Novice
Windows 10 Office 365
Join Date
Jul 2020
Posts
2
Originally Posted by Bob Fitz
Try:
=Iff([orride1])<0,([orride1]), "0.00​")
Thank you, Bob. That was a keying error on my part on this question. I do have a closing quote around 0.00 in my database. Any other ideas?

Thank you much!
Mandy

4. Access Developer
Windows 10 Access 2016
Join Date
May 2011
Location
Essex UK
Posts
2,519
Mandy

I did test the expression before I posted it, so if it didn't work for you then I only have two other suggestions to offer at the moment.

1) Forms and reports don't have field. They have controls that are usually bound to fields in the forms/reports Record Source but those controls don't necessarily have the same name as the field that they are bound to. Check that orride1 is the control name.

2) Post a copy of your db for us to examine. Remove any sensitive data. Enter a couple of records to illustrate the problem. Compact and Repair the db then zip it and post the zipped file.

5. VIP
Windows 10 Access 2010 32bit
Join Date
Mar 2015
Posts
8,387
Penny? post#1?, Mandy? post#3?

I presume iff is another typo - it should be iif

you should not mix datatypes - summing something implies a number, "0.00" is clearly text

suggest try

=iif(Sum([orride])<0,Sum([orride]),0)

or, depending on where you are going with this value, use the format property for the control to only display negative values or 0.00

controlsource - =
Sum([orride])
format property - "0.00";-#,##0.00,"0.00","0.00"

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Other Forums: Microsoft Office Forums - Senior Forums