Report won't keep its orientation setup

G

Guest

I have Acc2002 reports set for landscape. They work fine when printed by using
docmd.openreport. However, they are printed in portrait when printed by
using report variable, such as set xxx=a_report, xxx.visible = true, though
their previews look in landscape. Could anyone shed some light on it? Thanks.
 
G

Guest

here some stuff that might help out:

Dim DevString As str_DEVMODE
Dim DM As type_DEVMODE
Dim strDevModeExtra As String
Dim rpt As Report
'

'check if paper size and paper orientation are correct
If Not IsNull(rpt.PrtDevMode) Then
strDevModeExtra = rpt.PrtDevMode
DevString.RGB = strDevModeExtra
LSet DM = DevString
If DM.intPaperSize <> PSizeToBe Or DM.intOrientation <>
POrientationToBe Then
DM.intPaperSize = PSizeToBe
DM.intOrientation = POrientationToBe
LSet DevString = DM
strDevModeExtra = DevString.RGB
'rpt.PrtDevMode = strDevModeExtra
End If
End If
.DoCmd.Close acReport, ReportName, acSaveYes

Sorry I can't give more details but it might create some ideas for you.
This code works but its old code in a compiled program from long time ago, I
tried stepping through to get what the values are but in crashed VB on line:
strDevModeExtra = rpt.PrtDevMode
memory can't be read error.
 

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