Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with IIF syntax 1

Status
Not open for further replies.

Trudye

Programmer
Sep 4, 2001
932
US
Hey Accessers:

I am having a problem with syntax. I am trying to gray out a column under certain conditions using the IIF function.

If the company is closed that day my pgm places a "CC" in the field for that day. When I print out the grid I want to gray that field out. I am trying to use the IIF function, which is probably the wrong approach but its quick and easy.

Here is the statement I typed:
=IIf([D5]="CC","me!section!detail!D5.backcolor = 12632256")

Field = D5
the field is in the detail section of the report

Can anyone tell me how this command s/b structured? I have used IIF before in reports but never on properties.

Thanks
Trudye
 
hi Trudye,

You can't use the IIf function for that purpose because it just returns a value; it doesn't return an executable statement, which is what you would need to change the color. You might take a look at Conditional Formating in the Access Help as I think it does what you are looking for.

Best, dz
dzaccess@yahoo.com
 
Hey dZ:

Thanks so much, IT WORKS GREAT!!!

Trudye

P.S. I tried to give you an expert star but the function failed. I will try again tomorrow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top