Hide/Show Footer on Print (1 Viewer)

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 13:29
Joined
Feb 5, 2019
Messages
292
Hi all,

I have a report where I want to hide/show the report footer depending on a single field. When I preview the report, the code works fine. But if I direct print, it fails, unless I have previewed it first. This is an issue when I export to PDF and email as I do not preview the report first. I have the below code in both the Format and Print event procedures.

Code:
    If Me.txtNotes <> "" Then
        
        Me.ReportFooter.Visible = True
        Else
        Me.ReportFooter.Visible = False
    End If

Has anyone tried this before and managed to find an easy solution, or am I putting this in the wrong even procedure? I tried it in the footer section events, but that didn't work at all.

~Matt
 

June7

AWF VIP
Local time
Today, 05:29
Joined
Mar 9, 2014
Messages
5,423
I've never tried. But why not open in PrintPreview first anyway? Report can be not visible to user.
 

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 13:29
Joined
Feb 5, 2019
Messages
292
I've never tried. But why not open in PrintPreview first anyway? Report can be not visible to user.
Hi June,

If the PrintPreview option is the only solution, then I will do it this way. I was just hoping someone might know if I have put the code in the wrong event to make it work.

~Matt
 

June7

AWF VIP
Local time
Today, 05:29
Joined
Mar 9, 2014
Messages
5,423
I would expect it to work with footer Format and/or Print event. You say it does work if PrintPreview first but not direct to print/PDF. I cannot explain why.
 

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 13:29
Joined
Feb 5, 2019
Messages
292
I would expect it to work with footer Format and/or Print event. You say it does work if PrintPreview first but not direct to print/PDF. I cannot explain why.
It is strange. After previewing it, the export to PDF works. I am not that fussed now until the new year as I finish in 40 minutes :)
 

June7

AWF VIP
Local time
Today, 05:29
Joined
Mar 9, 2014
Messages
5,423
Events of the report footer section?
 

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 13:29
Joined
Feb 5, 2019
Messages
292
Events of the report footer section?
I have tried the report footer, and the page header. And the detail. I get the same result whichever location I put the code in.
 

Users who are viewing this thread

Top Bottom