Detail won't (it's blank) print if subreport in report footer has no data (1 Viewer)

cclark9589

Registered User.
Local time
Today, 03:02
Joined
Sep 22, 2008
Messages
79
Detail won't print if subreport in report footer has no data

This one is driving me nuts!

I have an invoice report, F101Invoices, with 2 subreports. Basic company info is in the report header with client name in page header.

At the top of the detail section I have an array of information related to any specific job such as JobID, FundID, EmpId, AudID, various dates and some other stuff.

The first subreport, F101Invoices_sRpt, which contains line-item detail of the billable charges, including any expenses, is contained in the detail section just below the varied information explained above. The second subreport, F101Invoices_ExpsRpt, is a detailed line-item expense type report and is contained in the report footer. Both subreports are linked to F101Invoices by JobID.

If a job has expenses, the report displays and prints out correctly, no problem. However if a job doesn't have any expenses, nothing prints or displays, other than the header and some static information at the top of the detail section even though there are billable fees. I placed the following code in F101Invoices.Detail OnFormat event:

Option Compare Database
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.F101Invoices_ExpsRpt.Report.HasData = True Then
Me.ReportFooter.Visible = True
Else
Me.ReportFooter.Visible = False
End If
End Sub

This layout technique and the above code are an exact copy of what I use in my time card reports. There are actually 2 subreports in the report footer of time cards, both related to expenses. One subreport is total expense, the second provides information on company paid expenses with a formula calculating reimburseable expenses. If there are no expenses for the pay period, the code above, applicable to the time card, hides the footer so that a blank page doesn't print yet it allows for the detail of all billable hours by job to print or display.

I have JobID (linked fields) in detail section of the invoices. I've tried putting in the page header (this is where the linked field resides in the time card) but this doesn't work either.

Spent the entire weekend getting a couple of issues fixed and working in this beast, a very good portion on this particular issue. Anyone got some ideas? I've got to get to bed before 2 in the morning see as how I have to go to work tomorrow!
 
Last edited:

wiklendt

i recommend chocolate
Local time
Today, 20:02
Joined
Mar 10, 2008
Messages
1,746
it's possible this is happening because you have INNER JOINS between your tables queries in your record source for the report. this means that the ID has to be present in BOTH tables, so if one doesn't exist, the other is also blank. you need LEFT or RIGHT joins in your report record source query.

unfortunately, i'm having issues using your database. i re-linked the backend, but i'm still getting file location error whenever i try to load an object (luckily i was able to open your parent report in design view):



more people might be able to give advice if you upload the database as a 2003-compatible version (many people still don't have access to office/access 2007).
 

Attachments

  • WPTBldg error.jpg
    WPTBldg error.jpg
    21.4 KB · Views: 1,107
Last edited:

cclark9589

Registered User.
Local time
Today, 03:02
Joined
Sep 22, 2008
Messages
79
Sorry, forgot to post.

I had gotten a response a while ago that no data was being returned, that nothing was there and I knew that had to be wrong, there had to be something there. Then it dawned on me that it most certainly must be in my queries and sure enough that is indeed what it was. Re-did my queries and now the invoives are coming up just as they should.

Thanks for the reply.
 

Users who are viewing this thread

Top Bottom