Print Reports from VBA

Skip Bisconer

Who Me?
Local time
Yesterday, 17:39
Joined
Jan 22, 2008
Messages
285
This doesn't make sense to me. These reports are generated from a command button base on a check box. All reports have the same Autoform Trex.

This prints in grey scale from a color printer

If Me.RouteA = True Then
DoCmd.OpenReport "rptDailyOrdersForRouteA", acViewNormal, "", "", acNormal
End If

This prints in color from a color printer

If Me.DriverA = True Then
DoCmd.OpenReport "rptItineraryRouteA", acViewNormal, "", "", acNormal
End If

Thanks for any help you may give me.
 
Yup...Ok. So what's the question?

The fact that each of the two Reports prints in a different color (probably because that's the way the Report was designed) or the fact that CheckBox RouteA and CheckBox DriverA is what allows it to happen?

:confused:

If CheckBox RouteA is checked marked then print the report rptDailyOrdersForRouteA.
If CheckBox DriverA is checked marked then print the report rptItineraryRouteA.

.
 
I designed all 21 of the the reports exactly in the same color scheme as I mentioned in my post and when I run this report from print view it prints in the correct manner as do all the other reports in the series. When I run these reports in code the one I mentioned runs in grey scale and all the rest run in the color scheme I designed into the reports. Why? That is the question I needed answered. The Format properties of these two reports in my post are identical. There is something I am not seeing.
 
Last edited:
when you say A colour ptinter, do you mean the SAME colour printer?
 
Yes, this process is still in development stage so I am just testing everything to my printer. I converted this code from a macro. I don't know if that has anything to do with it, . I wouldn't think so as all the other reports print fine, also, this is the first page of a tab form.

I don't know if when this gets to the field they will be using colour or b&w or what level of management will be looking at them. The higher up you go in this company the prettier they want it.
 
Last edited:
uhhhh...I see. That is an odd one.

Just poking about here...does the report contain Conditional Formating somewhere? Perhaps something went astray.

Does the same thing happen on another printer?

If you could post the Reports with some fictitious Data then we can see if the same thing develops in different environments.

.
 
After your help in looking at everything it had to be the report itself. I don't know what caused the problem with the original report but when I recreated the report as a test and ran it with code it printed correctly. There was no conditional formatting involved and I think with the new report I removed the printer out of the equation. I hate not knowing why because I am doomed to repeat it somewhere else.

Thanks for your input. I'm going to go with what works and get on with life.
 
I hate not knowing why because I am doomed to repeat it somewhere else.

I'm with you on that one Skip. It would definitely be nice to know what the cause may have been.

.
 

Users who are viewing this thread

Back
Top Bottom