I need to print reports embedded in navigation form. I was looking for a solution in the internet and seems like the best one is: https://www.experts-exchange.com/questions/28236835/print-current-report-inside-of-navigation-form-access-2010.html
People claim it works, however, I have a strange problem. This code always prints just one report, even though I have the same code in all of them.
I have modul1
Option Compare Database
Public strpubReportName As String
In all 3 reports and one form I have the same code:
Private Sub Report_GotFocus()
strpubReportName = Me.Name
End Sub
Then the button placed in a navigation form header has:
Private Sub Polecenie20_Click()
DoCmd.OpenReport strpubReportName
strprvtReportName = ""
End Sub
And it always prints just one report (not even the report that is displayed on default). No matter which report I open in a navigation form, only one will be printed.
Also why there is this line? This variable is not even created or used in this code, is it the author's mistake? I guess it doesn't matter because changing it to strpubReportName makes no difference.
strprvtReportName = ""