Formatting Not Working

D

DS

I have this on the On Current of a Subform
but its always making the Forecolor White.
Any Help appreciated.
Thanks
DS

Private Sub Form_Current()
If PaymentAmount > 0 Then
PaymentAmount.ForeColor = vbDarkGrey
Else
PaymentAmount.ForeColor = vbWhite
End If
End Sub
 
D

DS

DS said:
I have this on the On Current of a Subform
but its always making the Forecolor White.
Any Help appreciated.
Thanks
DS

Private Sub Form_Current()
If PaymentAmount > 0 Then
PaymentAmount.ForeColor = vbDarkGrey
Else
PaymentAmount.ForeColor = vbWhite
End If
End Sub
I Stand somewhat corrected...it works but doesn't. I'm using Continous
forms and the thing changes every record depending on the current
selection. I can't use the Conditional Formatting because it enables
the field. Unless there is a way to disable and lock the field in code
when you are using conditional formatting.
Thanks
DS
 
M

MacDermott

Conditional Formatting is the only way to have different formatting for
different rows in a continuous form. Enabled/disabled can be set as part of
the format.
 
D

DS

MacDermott said:
Conditional Formatting is the only way to have different formatting for
different rows in a continuous form. Enabled/disabled can be set as part of
the format.
It works, but I need the field locked and disabled. I see the enable
thing...but hey is there a way to do this in code where it would emulate
conditional formating?
Thanks
DS
 
M

MacDermott

If the field is always locked, just set it to locked in design view.

Conditional Formatting IS the way to achieve different formats in different
rows of a continuous form. You can invoke some Conditional Formatting in
code, but the approach you originally posted, where you simply change a
control's formatting in code, will always apply to all instances of that
control (one instance per row).

HTH
 
Top