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

Conditional shading

Status
Not open for further replies.

skoutr1

Technical User
Aug 9, 2001
22
0
0
US
Hi all-

I am trying to shade the rows of a report based on one of the fields. For example, if a certain field is null then I want to shade that row gray. I'm not sure how to set up the IF statement. I keep getting the error message "object needed". Here's what I have so far:

=========
Const WHITE = 16777215
Const GRAY = 12632256

If Me![Step2Request] Is Not Null And Me![Returned] Is Null Then
Me.Detail.BackColor = WHITE
Me.GroupFooter3.BackColor = WHITE
Else: Me.Detail.BackColor = GRAY And Me.GroupFooter3.BackColor = GRAY
End If

==========

Do I need a loop to account for each row? The "object needed" error occurs for the If statement.

Thanks in Advance.
Rod
 
Put the Const declarations at the beginning of the module for the form.

Put the if statement in the Detail_format event for the detail section.
You also should remove the colon :)) after the else statement and correct the rest of the else statement.

If Me![Step2Request] Is Not Null And Me![Returned] Is Null Then
Me.Detail.BackColor = WHITE
Me.GroupFooter3.BackColor = WHITE
Else
Me.Detail.BackColor = GRAY
Me.GroupFooter3.BackColor = GRAY
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top