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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using IIF statement in reports

Status
Not open for further replies.

kevinwilson

Technical User
Jul 13, 2001
33
US
Ok, so this is my second plea in one day, ...but whose counting anyway! As usual mucho mahalo's to anyone who can help!

Here's my dilemma.
In my shipment report, I would like to display all records shipped, including records that exceeded 10 days to ship (all records exceeding 10 shipping days would be highlighted in yellow). I'm not exactly sure on how to write this statement.

I think it would probably go something like this:
IIf([ShippedDate]-[ReceivedDate]>10 & "days to ship",then make this field yellow background,otherwise [ShippedDate]-[ReceivedDate]& "days to ship".

Is that enough to go on?
Thanks again,
Kevin
 
Hi, assuming you have a text box in the detail section of your report named DaysToShip, you could go to the reports Detail Format section in VB and place a statement in the the Private Sub:

if ([ShippedDate]-[ReceivedDate]>10 Then
me!daystoship.backcolor = 10092543 Else 'Light Yellow
me!daystoship.backcolor = 16777215) 'White

This would change the back color of the DaysToShip Text Box

Hope that helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top