cclark9589
Registered User.
- Local time
- Today, 08:25
- Joined
- Sep 22, 2008
- Messages
- 79
Believe me, I browsed through this forum until my fingers started bleeding!
I have a timesheet report with 3 subreports; billable hours, non-charge hours and expenses. Timesheet has a page header, there is no report header. Billable hours and non-charge hours invariably with have data however, many times the expense report will have nothing. The subreports lay out like this:
Billable Hours
Non-Chargeable Hours
Expenses
By necessity, there is a page break between non-chargeable and expenses. If there are no expenses for the pay period there is no need to print that report and therein lies my problem.
What happens is even if there is no data in the expense query for a pay period a subsequent page where the expense report would normally be will print anyway with just the page header information from the main report showing.
I have tried many of the suggested solutions but none have worked. I've put the HasData statements in timesheet report On No Data property as well as the detail section On Format and On Print properties. I've also tried putting the statement in the subreport itself in the same sections. I've played with the CanShrink/Grow properties too. All to no avail. The name of the subreport is JobExpsRpt.
Following are samples of the code I've tried using:
JobExpsRpt:
Private Sub Report_NoData(Cancel As Integer)
Me!JobExpsRpt.Visible = Me!JobExpsRpt.Report.HasData
End Sub
Timesheet:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FormatCount = 1 Then
Me![JobExpsRpt].Visible = Me![ JobExpsRpt].HasData
End If
End Sub
As mentioned, I've tried placing these in different locations on the two reports but no luck.
Can anyone point out to me where the code is wrong, how it should read and precisely where it should be placed? Is it possible the page header has something to do with it?
I've spent the better part of 5 hours today in addition to several hours yesterday trying to resolve this issue. Specific help for an Access Dummy would be greatly appreciated.
I have a timesheet report with 3 subreports; billable hours, non-charge hours and expenses. Timesheet has a page header, there is no report header. Billable hours and non-charge hours invariably with have data however, many times the expense report will have nothing. The subreports lay out like this:
Billable Hours
Non-Chargeable Hours
Expenses
By necessity, there is a page break between non-chargeable and expenses. If there are no expenses for the pay period there is no need to print that report and therein lies my problem.
What happens is even if there is no data in the expense query for a pay period a subsequent page where the expense report would normally be will print anyway with just the page header information from the main report showing.
I have tried many of the suggested solutions but none have worked. I've put the HasData statements in timesheet report On No Data property as well as the detail section On Format and On Print properties. I've also tried putting the statement in the subreport itself in the same sections. I've played with the CanShrink/Grow properties too. All to no avail. The name of the subreport is JobExpsRpt.
Following are samples of the code I've tried using:
JobExpsRpt:
Private Sub Report_NoData(Cancel As Integer)
Me!JobExpsRpt.Visible = Me!JobExpsRpt.Report.HasData
End Sub
Timesheet:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FormatCount = 1 Then
Me![JobExpsRpt].Visible = Me![ JobExpsRpt].HasData
End If
End Sub
As mentioned, I've tried placing these in different locations on the two reports but no luck.
Can anyone point out to me where the code is wrong, how it should read and precisely where it should be placed? Is it possible the page header has something to do with it?
I've spent the better part of 5 hours today in addition to several hours yesterday trying to resolve this issue. Specific help for an Access Dummy would be greatly appreciated.