Formatting Not Working

  • Thread starter Thread starter DS
  • Start date Start date
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
 
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
 
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.
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top