Skip Bisconer
Active Member
- Joined
- Jun 14, 2002
- Messages
- 263
I am trying to make the font color red in a form text box when the value is less than 0. I thought I knew how to do it but it's not working. This is just a look up form based on a selection from a combo box. I have removed the conditional formating from the spread sheet cells involved to see if that makes a difference but it doesn't seem to. Here is my code for one of several textboxes. I appreciate any help you can give me.
With frmEarnings
.txtDividends = Range("EarningCompany").Cells(cmbCompany.ListIndex + 1, 2)
.txtDividends.Value = Format(Val(txtDividends), "$#,##0.00")
If .txtDividends < 0 Then
.txtDividends.Font.ColorIndex = 3
Else
'No change
End If
End With
With frmEarnings
.txtDividends = Range("EarningCompany").Cells(cmbCompany.ListIndex + 1, 2)
.txtDividends.Value = Format(Val(txtDividends), "$#,##0.00")
If .txtDividends < 0 Then
.txtDividends.Font.ColorIndex = 3
Else
'No change
End If
End With