When trying to print a report in black & white on a colour printer the colour mode setter doesn't work, so the prints always come out coloured. The report's query source includes a criterion referencing a field on another form.
This is some code I've assembled from web searches for a simplified version of what I need
It looked as though it worked first time but now the report shows all data rather than just the records meeting the query criterion.
As I say, the objective is to force the colour mode change when the printer setup doesn't do it. The same code above works fine if the report's source is a simple query, not one with a criterion.
This is some code I've assembled from web searches for a simplified version of what I need
Code:
Dim stDocName As String
Dim rpt As Report
stDocName = "Test report"
DoCmd.OpenReport stDocName, acViewDesign, , "[Investment]=Forms![PickInvestment].Investment", acHidden
Set rpt = Reports("Test report")
rpt.Printer.ColorMode = acPRCMMonochrome
DoCmd.OpenReport stDocName, acViewPreview, , "[Investment]=Forms![PickInvestment].Investment"
It looked as though it worked first time but now the report shows all data rather than just the records meeting the query criterion.
As I say, the objective is to force the colour mode change when the printer setup doesn't do it. The same code above works fine if the report's source is a simple query, not one with a criterion.