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

SteveL13Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<Why would this be happening?>>

  Not quite sure I understand....you say the inactive record is not in the result set, but your still getting a section for it?   Do you have different filtering setup in the report?

 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.

  You can do this in preview as well and jump to the page in question (use the page number control at the bottom), instead of going page by page.

 Sounds to me though like either:

a. Your not getting the result set you expect.

b. Something other than an inactive record is causing a blank page and you just think it's an inactive record (your result set is correct).

Jim.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SteveL13Author Commented:
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."
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.