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

asked on

Why report printing a blank page?

I have a report which has a sub-report.  The subreport's record source is a query.  In the query is a field named inactive.  If the record is inactive then the query does not reflect that particular record.  This is working fine.

But I have the following code in the onformat event of the subreport.  The problem is... the report is printing a blank page for the record that is inactive.  Why would this be happening?

Here is the code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    
    Dim n As Integer
    Dim strClientFolderName As String
    Dim strFileName As String
    Dim strPropertyAssetFolderName As String
    Dim strPropertyFolderName As String
    Dim strPropertyRoomName As String

    n = 1
    strClientFolderName = TempVars!strPicturesDataPath & "\" & Trim(Me.txtClientTableID) & "\"
    strPropertyFolderName = strClientFolderName & Trim(Me.txtPropertyTableID) & "\"
    strPropertyRoomName = strPropertyFolderName & Trim(Me.txtRoomDetailID) & "\"
    strPropertyAssetFolderName = strPropertyRoomName & Trim(Me.txtManualAssetN)

    Me.AssetImage1.Picture = strPropertyAssetFolderName & "\" & Me.PrimaryPictureFile
    Me.AssetImage2.Picture = ""
    Me.AssetImage3.Picture = ""
    Me.AssetImage4.Picture = ""

    strFileName = Dir(strPropertyAssetFolderName & "\")
    Do While strFileName <> ""
        If strFileName <> Me.PrimaryPictureFile Then
            Select Case n
                Case 1
                    Me.AssetImage2.Picture = strPropertyAssetFolderName & "\" & strFileName
                Case 2
                    Me.AssetImage3.Picture = strPropertyAssetFolderName & "\" & strFileName
                Case 3
                    Me.AssetImage4.Picture = strPropertyAssetFolderName & "\" & strFileName
                Case Else
            End Select
            n = n + 1
        End If
        strFileName = Dir
    Loop

End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
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
Avatar of SteveL13

ASKER

This helped me get to the solution.  Thanks.

"What I would suggest is that you put a STOP at the top of the code and then walk through the code.  Use F5 to continue on when you hit a record that your sure should print and F8 to step through the code when you hit the blank page."