J
Jim Satterfield
I posted this once before but got pulled from this task and now that I'm
back to it the message is no longer on the server. I am using an mdb file
for the backend of this system but doing all the coding in VB 6. When the
reports on legal size paper are printed but the legal tray is empty and not
filled fast enough the report prints on letter and then keeps the setting to
use letter. When I try to put some code in to force the paper size back to
legal I get an error code 2501 and the message that "The Save action was
cancelled.". Here's the code:
If Not IsNull(rpt.PrtDevMode) Then
strDevModeExtra = rpt.PrtDevMode
DevString.RGB = strDevModeExtra
LSet DM = DevString
DM.lngFields = DM.lngFields Or DM.intOrientation 'Initialize fields.
DM.intPaperSize = 5 'Legal size
DM.intOrientation = 2 'Landscape
LSet DevString = DM 'Update property.
Mid(strDevModeExtra, 1, 94) = DevString.RGB
rpt.PrtDevMode = strDevModeExtra
DoCmd.Save acReport, strName
DoCmd.Close acReport, strName
objAccess.Quit acExit
Set objAccess = Nothing
End If
When I go to debug it the DoCmd.Save line is selected. The variables appear
to have the correct values. Any ideas?
Jim
back to it the message is no longer on the server. I am using an mdb file
for the backend of this system but doing all the coding in VB 6. When the
reports on legal size paper are printed but the legal tray is empty and not
filled fast enough the report prints on letter and then keeps the setting to
use letter. When I try to put some code in to force the paper size back to
legal I get an error code 2501 and the message that "The Save action was
cancelled.". Here's the code:
If Not IsNull(rpt.PrtDevMode) Then
strDevModeExtra = rpt.PrtDevMode
DevString.RGB = strDevModeExtra
LSet DM = DevString
DM.lngFields = DM.lngFields Or DM.intOrientation 'Initialize fields.
DM.intPaperSize = 5 'Legal size
DM.intOrientation = 2 'Landscape
LSet DevString = DM 'Update property.
Mid(strDevModeExtra, 1, 94) = DevString.RGB
rpt.PrtDevMode = strDevModeExtra
DoCmd.Save acReport, strName
DoCmd.Close acReport, strName
objAccess.Quit acExit
Set objAccess = Nothing
End If
When I go to debug it the DoCmd.Save line is selected. The variables appear
to have the correct values. Any ideas?
Jim