Receiving An Error If No Variance In My Report

jfrink2

New member
Local time
Today, 04:38
Joined
Mar 3, 2008
Messages
6
Hi All,

I have a report that calculates variances. For example, there are 2 columns on my report. One has # of Hours from one system and the other column shows # of Hours from a second system. I then have a column that displays any variance that may occur.

When there is a variance, the report runs just fine. But if the Variance amount is = 0, then I receive an error message saying:

Run Time Error '2427':

You have entered an expression that has no value.

And when I click Debug, It highlights the area below in BLUE in Visual Basic.

-----------------
Option Compare Database
Option Explicit

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Me.ctl_Variance = 0 Then
Me.ctl_Variance.ForeColor = 0
Else
Me.ctl_Variance.ForeColor = 255
End If
End Sub

Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
End Sub
-------------

Any recommendations on how to resolve this would be greatly appreciated.
 
If you break on that line, and do ? me.ctl_variance in the immediate window, what does it say?
 

Users who are viewing this thread

Back
Top Bottom