Individual formatting on a text box on a report w/tabular layou?

  • Thread starter Thread starter plh
  • Start date Start date
P

plh

Hyall,
I can change the background color of the detail in a report with tabular layout
(that is, similar to a continuous form) using Detail_Format:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
With Me
Select Case .txtCondition
Case "Green"
.Section("Detail").BackColor = vbWhite
Case "Yellow"
.Section("Detail").BackColor = vbYellow
Case "Red"
.Section("Detail").BackColor = vbRed
End Select
End With
End Sub

But what I want to do is change the background color of an individual text box
within the section. I tried:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
With Me
Select Case .txtCondition
Case "Green"
.txtCondition.BackColor = vbGreen
Case "Yellow"
.txtCondition.BackColor = vbYellow
Case "Red"
.txtCondition.BackColor = vbRed
End Select
End With
End Sub

But that had no effect. Is there some way to do it?
Thank You,
-plh
 
Is there some way to do it?

Depends on your Access version. Select the textbox in design view and use
Format... Conditional Formatting from the menu.

John W. Vinson [MVP]
 
Depends on your Access version. Select the textbox in design view and use
Format... Conditional Formatting from the menu.

John W. Vinson [MVP]

Perfect -- Thank you Mr. Vinson!!
-plh
 
Back
Top