Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Displaying on a report

I have this code in the onprint event of the detail section of a report which works fine if there is data:

    If Me.txtType2 = "COMPLETE" Then
        Me.chkbxConformed.Visible = True
        Me.txtRetDate.Visible = False
    End If

    If Not IsNull(Me.txtRetDate) Then
        If Me.txtType2 = "PLATING" Or Me.txtType2 = "CALIBRATION" Or Me.txtType2 = "CHECK FIT" Then
            Me.chkbxConformed.Visible = False
            Me.txtRetDate.Visible = True
        End If
    End If

Open in new window


But if the report has no data I get an error that reads, "You entered an expression that has no value.  The debug highlights the first line of the code.  How do I avoid this?
Avatar of SteveL13
SteveL13
Flag of United States of America image

ASKER

Sorry...  correction in code:

    If Me.txtType2 = "COMPLETE" Then
        Me.chkbxConformed.Visible = True
        Me.txtRetDate.Visible = False
    End If

    If Me.txtType2 = "PLATING" Or Me.txtType2 = "CALIBRATION" Or Me.txtType2 = "CHECK FIT" Then
        Me.chkbxConformed.Visible = False
        Me.txtRetDate.Visible = True
    End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial