Highlighting fields (1 Viewer)

saintsman

Registered User.
Local time
Today, 08:39
Joined
Oct 12, 2001
Messages
138
I,ve been fiddling for ages so someone help me out please. I don't know VBA but I have got the following to work:

Private Sub Form_Current()

If Date_Forecast.Value = Date + 1 Then
Date_Forecast.BackColor = 26367

Else: Date_Forecast.BackColor = 16777215

If Date_Forecast.Value < Date Then
Date_Forecast.BackColor = 255

Else: Date_Forecast.BackColor = 16777215


End If
End If

End Sub

However I only want the fields coloured if another field (Date Received) is blank. What do I need to include first?

Thanks in advance,
Saintsman
 

IMO

Now Known as ___
Local time
Today, 08:39
Joined
Sep 11, 2002
Messages
723
I think this is what you need...
Code:
Private Sub Form_Current() 

If IsNull (Me.Date_Received) and Me.Date_Forecast.Value = Date + 1 Then 
Date_Forecast.BackColor = 26367 
Else
Date_Forecast.BackColor = 16777215 
End If


If IsNull (Me.Date_Received) and Date_Forecast.Value < Date Then 
Date_Forecast.BackColor = 255 
Else
Date_Forecast.BackColor = 16777215 
End If 
 

End Sub

IMO
 
Last edited:

saintsman

Registered User.
Local time
Today, 08:39
Joined
Oct 12, 2001
Messages
138
Perfect.

Thank you very much.
 

IMO

Now Known as ___
Local time
Today, 08:39
Joined
Sep 11, 2002
Messages
723
You're welcome

IMO
 

Users who are viewing this thread

Top Bottom