Solved

Paper Size in Access 2.0

Posted on 1997-10-30
12
305 Views
Last Modified: 2011-09-20
How do you change the paper size in Access 2.0?  In page set up, there is a user defined page size, but I suppose it needs to be set in code.
0
Comment
Question by:BBrian
  • 7
  • 5
12 Comments
 

Author Comment

by:BBrian
ID: 1958086
Here is the code I tried...

Dim dm As zwtDevModeStr ' Structures defined in zwAllGlobals module in WZFRMRPT.MDA.
    Dim devmode As zwtDeviceMode
    DoCmd OpenReport myreport, A_DESIGN
    Reports(myreport).Painting = False
    If Not IsNull(Reports(myreport).PrtDevMode) Then
        dm.rgb = Reports(myreport).PrtDevMode
        LSet devmode = dm
        devmode.dmPaperSize = mypapersize
         devmode.dmPaperlength = 500
          devmode.dmPaperWidth = 10000
        LSet dm = devmode
        Reports(myreport).PrtDevMode = dm.rgb
        DoCmd SetWarnings False
        DoCmd DoMenuItem 7, A_FILE, 2
                DoCmd SetWarnings True
    End If

    Reports(myreport).Painting = True
    DoCmd Close A_REPORT, myreport

0
 
LVL 4

Expert Comment

by:ozphil
ID: 1958087
Code looks good. Where does it not work?
0
 
LVL 4

Accepted Solution

by:
ozphil earned 100 total points
ID: 1958088
You set devmode.dmPaperSize = 256 to indicate a custom paper size.

if its not 256, the its not a custom paper size

then you set
devmode.dmPaperlength = myLength *254  'mylength in inches
devmode.dmPaperWidth = myWidth *254    'myWidth in inches

0
 

Author Comment

by:BBrian
ID: 1958089
My understanding is the papersize codes 1 -41 are pre-defined sizes and 256 is the user defined size.  When I run the code it does change the paper size, but only to the smallest settings.
When I preview or print the size remains the smallest no matter what I declare in code. Here, again, is the code:

Sub papersize (myreport As String, mypapersize As Integer, mypapersizeLength As Integer, mypapersizeWidth As Integer)
    Dim dm As zwtDevModeStr ' Structures defined in zwAllGlobals module in WZFRMRPT.MDA.
    Dim devmode As zwtDeviceMode
    DoCmd OpenReport myreport, A_DESIGN
    Reports(myreport).Painting = False
    If Not IsNull(Reports(myreport).PrtDevMode) Then
        dm.rgb = Reports(myreport).PrtDevMode
        LSet devmode = dm
        devmode.dmPaperSize = mypapersize
         devmode.dmPaperlength = mypapersizeLength
          devmode.dmPaperWidth = mypapersizeWidth
        LSet dm = devmode
        Reports(myreport).PrtDevMode = dm.rgb
        DoCmd SetWarnings False
        DoCmd DoMenuItem 7, A_FILE, 2
                DoCmd SetWarnings True
    End If

    Reports(myreport).Painting = True
    DoCmd Close A_REPORT, myreport

0
 
LVL 4

Expert Comment

by:ozphil
ID: 1958090
ok.back to the drawing board. Keyboard?
0
 
LVL 4

Expert Comment

by:ozphil
ID: 1958091
i assume you are running this in Windows 95. Is this correct.
There are some changes to the  zwtDevModeStr structure in win95.

In addition to this could you note  ther following:
----extract from MS-----
 In the sample code above, change the last seven lines of code just below the line that read "Reports(MyReport).PrtDevMode = dm.rgb" to read as follows:

             DoCmd SetWarnings False
             DoCmd SetWarnings True
        End If

        Reports(MyReport).Painting = True
        DoCmd DoMenuItem 7, 0, 2, , A_MENU_VER20  ' Report|File|Save.
        DoCmd Close A_REPORT, MyReport
   End Function
-----extract from MS-------


0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:BBrian
ID: 1958092
Ozphil, I am using Windows 3.11
0
 
LVL 4

Expert Comment

by:ozphil
ID: 1958093
Windows 3.11.

Im glad i asked the question. :)

Have you done the changes fro MS Access 2.O as described above.
0
 

Author Comment

by:BBrian
ID: 1958094
yes I tried.  
the only difference was that the report closed without promting
me to save the changes.  However, I have been able to change the
paper size when I set papersize to 0.  But I still can't get the
size to change much.  I am trying to set the size to 2 x 4 inches.  Perhaps there is a limit.  But It doesn't even change to
4 x 6.  The user-defined size produces a size too small.
0
 
LVL 4

Expert Comment

by:ozphil
ID: 1958095
I dont have 3.11 to try it out.

Have you tried the code with other printer drivers?

And you are multiplying inches say by 254.


0
 

Author Comment

by:BBrian
ID: 1958096
Ozphil, I sent a copy of the problem to microsoft.  They could not solve it.  They gave me a work around.  Install the same printer with a different port and a different defined paper size.
They did not elaborate why it did not function as it should.  To my knowledge I can't withdraw the question.  So you can have all the points.
0
 
LVL 4

Expert Comment

by:ozphil
ID: 1958097
Hi bbrian. just got back from a break.

Thanks for the points although the only contribution was to confirm that the problem was unsolvable. I hope MS did not charge you. Their policy is not to charge for bugs, and this appears to be one.


0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now