Snapshot

fuzzygeek

Energy Ebbing
Local time
Today, 22:25
Joined
Mar 28, 2003
Messages
989
Use this code as a sort of example

Function TestRpts()
Dim strRptName As String
Dim StrLimitsAre As String
Dim rptReport As Report

Set rptReport = New NameOfReport
strRptName = "NameOfReport"
StrLimitsAre = "Dept = " & """MentalWard"""
rptReport.Filter = StrLimitsAre
rptReport.FilterOn = True

DoCmd.OutputTo acOutputReport, strRptName, acFormatSNP, , True

rptReport.FilterOn = False
rptReport.Filter = ""
Set rptReport = Nothing
Debug.Print StrLimitsAre

End Function

I used this to create a snap report from one of my reports. There may be better ways to do this, but it worked.
 
OOPS

This was supposed to be a reply to the snapshot issue...ignore
 
PHP:
rptReport.FilterOn = False 
rptReport.Filter = "" 
Set rptReport = Nothing 
Debug.Print StrLimitsAre

What does this piece of code do?
:confused:
 
No code that is written is bad code, it can always be a good example of what not to do. This is an example of overprogramming and failing to remove the debug statement. You do not have to reset the filter and filter on properties since the next step is setting the report object to nothing. You would set them if you were going to output the report with no filter.
 

Users who are viewing this thread

Back
Top Bottom