Printing with page-breaks (1 Viewer)

Lkwdmntr

Registered User.
Local time
Yesterday, 21:35
Joined
Jul 10, 2019
Messages
277
I am having another issue dealing with printing my reports.

I have a counter in my footer and if it gets to 40, I have several things that happen.

1. I make my one header for a subreport disappear.
2. A header in another subreport appears.
3. One of my page breaks becomes visible.
4. Another page break becomes invisible.

In print preview, it is doing everything correctly, but when I go to print, the page break that was invisible in preview becomes visible when printing. This gives me 3 pages when I only want 2.

Anyone have any ideas about what might be happening. Here my VBA code, perhaps something is wrong with it, although I don't understand why it shows in the preview correctly.

Private Sub Report_Load()

If Me.TotRec > 39 Then
Me.MaLhdr.Visible = False
Me.BreakMLA.Visible = True
Me.BreakNSA.Visible = False
Form_SubReport_MonMALChallenges.subMALhder.Visible = True
Else
Me.MaLhdr.Visible = True
Form_SubReport_MonMALChallenges.subMALhder.Visible = False
Me.BreakMLA.Visible = False
Me.BreakNSA.Visible = True
End If
DoCmd.Maximize

End Sub​
 

Lkwdmntr

Registered User.
Local time
Yesterday, 21:35
Joined
Jul 10, 2019
Messages
277
Well, I think I know what is happening. I was using a macro and it without loading the form first. I still would like to see the preview before I print. I have used this code.

DoCmd.OpenReport "Tue_Reporting_Form", acViewPreview
DoCmd.RunCommand acCmdPrint

I also got a macro to do the same thing, but I can't preview the report until I hit print.
 

Users who are viewing this thread

Top Bottom