Adding FormatCondition With Code

  • Thread starter Thread starter Roy Goldhammer
  • Start date Start date
R

Roy Goldhammer

Hello there

Is there a way to add FormatCondition to any form on my Application to any
Textbox or combobox?
 
I don't fully follow what you're after. If, in design view, you right click
the control and choose Conditional Formatting, will that do what you want?
 
Yes.

here is an example:

Set fmtcond = ctlMyWidget.FormatConditions.Add(acFieldHasFocus)
With fmtcond
.BackColor = RGB(230, 255, 230) '<<- that is verypalegreen
.ForeColor = vbBlackorange 'vbBlack ''vbdarkorange
.FontBold = True
End With
 
Back
Top