Now I'm confused, see OP code showing the open report to effect the dynamic filtering
Code:
Option Compare Database
Option Explicit
Dim ShellString As String
Dim ShellRC As Variant
Public WithEvents Target As Access.CommandButton
Private Sub Target_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Me.Target.Name = "cmdPrintRegistry" Then
strCurRptsPath = "c:\Asilomar\PDF-Reports"
strCurPDFName = strCurRptsPath & "\ForestLodgeRegistry.pdf"
DoCmd.OpenReport "rptEntireRegister", acViewPreview, , , acHidden <<<<<<<<<< Open report to populate the dynamics
DoCmd.OutputTo acOutputReport, "rptEntireRegister", acFormatPDF, strCurPDFName
DoCmd.Close acReport, "rptEntireRegister", acSaveNo
ShellString = "c:\Windows\Explorer.exe " & """" & strCurPDFName & """"
ShellRC = Shell(ShellString, 4)
End If
End Sub
I substituted the troublesome report name in the app's form that deals with all the other reports that use a common class module and the same code in the OP works fine
Works great when functionality is launched from same form as the one for all the other reports. (as posted in #6)