Highlighting fields (1 Viewer)

saintsman

Registered User.
Local time
Today, 00:45
Joined
Oct 12, 2001
Messages
138
I've got a simple bit of code but I keep getting an error message.

"You entered an expression that has no value.The expression may refer to an object that has no value, such as a form , report or a label control."

All I wish to do is highlight the fact that my forecast date is overdue.

Private Sub Report_Open(Cancel As Integer)

Select Case Me.Date_Forecast

Case Is < Date


Me.Date_Forecast.FontBold = True
Me.Date_Forecast.ForeColor = 255

Case Else
'don't do anything, print with normalreport font.
End Select

End Sub


Once again your help will be appreciated.
 

IMO

Now Known as ___
Local time
Today, 00:45
Joined
Sep 11, 2002
Messages
723
Copy this code to the reports detail
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.Date_Forecast < Date Then
Me.Date_Forecast.FontBold = True
Me.Date_Forecast.ForeColor = 255

Else

Me.Date_Forecast.FontBold = False
Me.Date_Forecast.ForeColor = 0

End If

End Sub
IMO
 

saintsman

Registered User.
Local time
Today, 00:45
Joined
Oct 12, 2001
Messages
138
Thanks IMO,

Sorry to ask again but where exactly do you mean when you say the report's detail?
 

IMO

Now Known as ___
Local time
Today, 00:45
Joined
Sep 11, 2002
Messages
723
Open the report in Design view, Goto Tools >>> View >>> Code and paste the code in there.

IMO
 

saintsman

Registered User.
Local time
Today, 00:45
Joined
Oct 12, 2001
Messages
138
Simple when you know how.

Thank you for your help IMO.

Saintsman
 

IMO

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

IMO
 

Users who are viewing this thread

Top Bottom