M
mary r
In Access 2003, I have a report that I want to use with a Where Condition to
create a file. It doesn't much matter whether the destination format is rtf
with OutputTo or pdf using Steven Lebans' ConvertReportToPDF module; what
does matter is that the report is filtered using a coded Where condition and
that the report preview window NOT open.
I've tested this:
dtMyDate = Now()
stReportName = "MyReport"
stWhereCond = "MyReportSource.dtmMyDate = " & CStr(dtMyDate)
stFilePath = "MyDirectory\MyFileName.pdf"
....
DoCmd.OpenReport stReportName, acViewPreview, , stWhereCond, acHidden
blRet = ConvertReportToPDF(stReportName, , stFilePath, False, False)
The PDF creation works fine; what's driving me bonkers is that the acHidden
parameter seems to be toggling: every 2nd time I test, the report preview
window opens!
I've tried sending the report to rtf using OutputTo instead, but OutputTo
doesn't seem to accommodate filters or Where conditions.
Can anyone shed some light on this?
TIA-
mary
create a file. It doesn't much matter whether the destination format is rtf
with OutputTo or pdf using Steven Lebans' ConvertReportToPDF module; what
does matter is that the report is filtered using a coded Where condition and
that the report preview window NOT open.
I've tested this:
dtMyDate = Now()
stReportName = "MyReport"
stWhereCond = "MyReportSource.dtmMyDate = " & CStr(dtMyDate)
stFilePath = "MyDirectory\MyFileName.pdf"
....
DoCmd.OpenReport stReportName, acViewPreview, , stWhereCond, acHidden
blRet = ConvertReportToPDF(stReportName, , stFilePath, False, False)
The PDF creation works fine; what's driving me bonkers is that the acHidden
parameter seems to be toggling: every 2nd time I test, the report preview
window opens!
I've tried sending the report to rtf using OutputTo instead, but OutputTo
doesn't seem to accommodate filters or Where conditions.
Can anyone shed some light on this?
TIA-
mary