Change Forecolor based upon if statement

  • Thread starter Thread starter rbb101
  • Start date Start date
R

rbb101

On a form I have two controls named [Con1] and [Con2]. On Exit of a third
control [ConComm], I am trying to change the font of Label304 only if [Con1]
And [Con2] are Not empty or Not Null.

So If both [Con1] and [Con2] have entries,
then Me.Label304.Forecolor=50787 Else (if there are no entries)
Me.Label304.Forecolor= 6697728
 
Thanks. Thats exactly what I was looking for.

Marshall Barton said:
rbb101 said:
On a form I have two controls named [Con1] and [Con2]. On Exit of a third
control [ConComm], I am trying to change the font of Label304 only if [Con1]
And [Con2] are Not empty or Not Null.

So If both [Con1] and [Con2] have entries,
then Me.Label304.Forecolor=50787 Else (if there are no entries)
Me.Label304.Forecolor= 6697728


If the for is displayed in single view, you can use VBA code
to do that:

If Not IsNull(Con1) And NotIsNull(Con2) Then
Me.Label304.Forecolor=50787
Else 'if there are no entries
Me.Label304.Forecolor= 6697728
End If
 
Back
Top