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 Formatting of Row 1

Status
Not open for further replies.

TBOB

Technical User
Jun 22, 2002
65
0
0
US
I have a report that has 4 columns. One of the columns is the result of a check box in a form. What I'm trying to do is anytime the value of that text box in the report = -1 change the backcolor of the other three columns in that row. Here is what I have so far:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.txtMIDPOS = -1 Then
Me.txtSECNUM.BackColor = 255
Me.txtSECIDENT.BackColor = 255
Me.txtSECNAME.BackColor = 255
End If

End Sub

It doesn't change anything. Right now I know there are 7 instances where the txtMIDPOS value is -1, but when I step it through the code it is seeing 11 instances. Any help would be appreciated.

Thanks,

Tony
 
First, you probably need to add an "Else" section to the code to set the BackColor to vbWhite from vbRed. Then, make sure the control backgrounds are not set to transparent.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Both items mentioned were required. Thanks for the help.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top