Gina,
Thanks.
Checking the database again today I noticed two essential lines of code missing ........
Option Compare Database
Option Explicit
I got home - and I added these - but it still didn't work!
In answer to the questions you asked -
1. I created a group footer in the report for each record from the data source. I then adapted and posted your code in the On Format Event for this footer.
2. It's a main report/ sub report scenario. There are no sub sub reports.
3. This is the code in the group footer OnFormat event:
Option Compare Database
Option Explicit
____________________________________________________
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
On Error Resume Next
If Me.rpt_InvoiceSubDetails.Report.HasData Then
Me.rpt_InvoiceSubDetails.Visible = True
Me.GroupFooter0.Visible = True
Me.ServLine_Label.Visible = True
Me.ContractRef.Visible = True
Me.Report.Visible = True
Else
Me.GroupFooter0.Visible = False
Me.Contractor.Visible = False
Me.rpt_InvoiceSubDetails.Visible = False
Me.ServLine_Label.Visible = False
Me.ContractRef.Visible = False
End If
End Sub
____________________________________________________________
Note. I added other bits and pieces to the code as you can i.e. fields, labels etc to see if it would work with these rather than the whole sub report.
3. The name of the main report is: - rpt_Invoices2Pay
and the sub report: - rpt_InvoiceSubDetails
4. Yes to both.
Would it be of any help if I posted an extract from the database with the tables and report etc?
I have added two screen prints of the design of the report and report in view.
Once again thanks for your help.