Visibility of subreport (1 Viewer)

mounty76

Registered User.
Local time
Today, 12:49
Joined
Sep 14, 2017
Messages
341
Hi All,

I have the below code in the 'on format' event of a report footer, idea is to hide a subreport should nrecords>0, it works fine when I open the report and does everything expected, however when I print preview the report the subreport is missing when it should be there and it shows in the report?? Any ideas?

Code:
Dim nrecords As String

nrecords = DCount("*", "NewSuppliersforOffice")

If nrecords > 0 Then

Me.NewSuppliers.Visible = False

Else

Me.NewSuppliers.Visible = True

End If
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:49
Joined
Sep 21, 2011
Messages
14,310
So if you have new suppliers, you do not want to show them? 🤔
 

mounty76

Registered User.
Local time
Today, 12:49
Joined
Sep 14, 2017
Messages
341
Haha! Ah this is for an invoice report that I send weekly for payments, any new suppliers I need to provide contact details for so that the office can verbally confirm wire instructions, I only need to send this contact information once when I enter a new supplier, I have put this as a subreport at the bottom of the weekly payment instruction. I have a Yes/No box in the supplier table to confirm if the contacts have been sent to the office, this is updated with a query once the report is sent (along with a Yes/No box in the expenses table to confirm that the invoice has been sent).

Not sure why in the report view it works but in the print preview it doesn't show the subreport at all?
 

Users who are viewing this thread

Top Bottom