Save action cancelled

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
 
A

Allen Browne

Jim, is the report open in design view when you are trying to do this and
save the changes?

See if that makes a difference.
 
J

Jim Satterfield

Yes, it is open in design view. The line of code opening the report is this
one.

DoCmd.OpenReport strName, acDesign


Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top