?
Solved

Access 2000: Changing the Pagesize of a Report at runtime

Posted on 2005-04-26
5
Medium Priority
?
384 Views
Last Modified: 2012-06-27
Hi

I don't think this is possible but its worth an ask anyway.  Is it possible to change the Pagesize of a Report from A4 to Letter and back without going into Design mode.  I need to be able to do this on a Windows 2000 Server machine that only has the Access 2000 runtime installed.

Thanks



Stuart
0
Comment
Question by:thew00d
  • 3
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
thenelson earned 2000 total points
ID: 13868615
Yes, it is.  Not directly in Access VBA however.

1. Open up the Printing Preferences from Windows (not in Access) and set the settings you want for one setting.
2. In Run type:
    rundll32 printui.dll,PrintUIEntry /Ss /n "the printer name in quotes" /a "the path and name of a file to store the settings in quotes" u
    Example:  rundll32 printui.dll,PrintUIEntry /Ss /n "Okipage 10I" /a "C:\FolderA\OkiA4.ptr" u
    This will create a file with the settings you want.
3. In VBA code before the print command put:
     rundll32 printui.dll,PrintUIEntry /Sr /n "the printer name in quotes" /a "the path and name of a file to store the settings in quotes" u
    Example:  rundll32 printui.dll,PrintUIEntry /Sr /n "Okipage 10I" /a "C:\FolderA\OkiA4.ptr" u

Don't forget the "u" on the end or it will not work for anyone with less than Power User privledges.

This will change the settings for the printer for all applications on the computer so you would also want to save the printer settings to a file (with the /Ss switch) before changing it; then change it back to the original settings.

In my database, I have a form called Printer Settings where I can store the printer and its settings for every printing event in my database and a module that handles all the printer changes.  If you would like a copy of that, let me know.  I will pull it out, create a new demo db with just that in it and post it somewhere for you.

0
 
LVL 2

Author Comment

by:thew00d
ID: 13873792
Thanks for that - does the job perfectly.  If there's a demo db then I'm all for that - let me know where I can d/l it from.  If you don't get the time, then I should be able to come up with something myself.

Thanks


Stu
0
 
LVL 39

Expert Comment

by:thenelson
ID: 13880249
I'll have that demo db later today or tommarrow.  Glad I could help.
0
 
LVL 39

Expert Comment

by:thenelson
ID: 13881749
Stu,

I put the Printer Setup Demo.Zip at: http://www.nosuffering.com/Nelson/
0
 
LVL 2

Author Comment

by:thew00d
ID: 13883330
Got it.  Thanks again
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

840 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