Expression has no value (1 Viewer)

keving99

Registered User.
Local time
Yesterday, 17:34
Joined
May 13, 2007
Messages
14
I have a field on a report i want to change the forecolor if its value is 0, the field is a number field.
I have the follwoing code in the on open section

If Nz(Me!Txt1, 0) = 0 Then
Txt1.ForeColor = RGB(0, 255, 0)
End If

When i open the report i get
Run-time error'-2147352567 (80020009)
You entered an expression that has no value

There are records for the report and i have some on no data code.
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:34
Joined
Jul 2, 2005
Messages
13,825
Have you tried just using Conditional Formatting?
 

keving99

Registered User.
Local time
Yesterday, 17:34
Joined
May 13, 2007
Messages
14
Have you tried just using Conditional Formatting?

RuralGuy, yes i did that first, but the report is exported to HTML and it gets lost on conversion.

Thanks
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:34
Joined
Jul 2, 2005
Messages
13,825
Use the DetailPrint event rather than the Open event of the report.

Edit: That would be the Print event of the Detail section of the report.
 

keving99

Registered User.
Local time
Yesterday, 17:34
Joined
May 13, 2007
Messages
14
Thanks RuralGuy, fantastic, it works and it keeps its formating when converted to HTML.
Nice one :D

KevinG
 

Users who are viewing this thread

Top Bottom