Set PageSetup with code

  • Thread starter Thread starter Jean
  • Start date Start date
J

Jean

I have an Access 2000 report that I want to print to an
unknown printer (whatever printer the user has set as the
default). How do I set the page setup to 'fit to page
width' using VBA code?

I have done this in an Excel 2000 program in the past but
I can't find anyway to do this in Access.

Currently some users get the message "The section width is
greater than the page width..." when the report is
displayed in preview mode. This situation then causes
every other page in the report to be blank.

I think the 'fit to page width' setting should resolve
this problem, right?

Thanks for any help,
Jean
 
Jean said:
I have an Access 2000 report that I want to print to an
unknown printer (whatever printer the user has set as the
default). How do I set the page setup to 'fit to page
width' using VBA code?

I have done this in an Excel 2000 program in the past but
I can't find anyway to do this in Access.

Access doesn't have this feature.
Currently some users get the message "The section width is
greater than the page width..." [snip]

This means you have your margins set outside the maximum settings for some
user's printers. Either redesign the report to fit on the printer with the
worst case maximum settings or tell those users to use a different printer.
 
Thanks for the response.

I understand what the message is telling me and I know
changing the printer resolves the problem but I am trying
to find a way to prevent this situation from occurring in
the first place.

The report size is as small as it can be to still include
all of the data the customer has requested. I was hoping
to put code in place to compensate for the situation.

If I were to redesign the report, how do I determine
the "worst case maximum settings"? This application is
distributed to a wide customer base.

Jean
-----Original Message-----
Jean said:
I have an Access 2000 report that I want to print to an
unknown printer (whatever printer the user has set as the
default). How do I set the page setup to 'fit to page
width' using VBA code?

I have done this in an Excel 2000 program in the past but
I can't find anyway to do this in Access.

Access doesn't have this feature.
Currently some users get the message "The section width is
greater than the page width..." [snip]

This means you have your margins set outside the maximum settings for some
user's printers. Either redesign the report to fit on the printer with the
worst case maximum settings or tell those users to use a different printer.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


.
 
Jean said:
Thanks for the response.

I understand what the message is telling me and I know
changing the printer resolves the problem but I am trying
to find a way to prevent this situation from occurring in
the first place.

The report size is as small as it can be to still include
all of the data the customer has requested. I was hoping
to put code in place to compensate for the situation.

If I were to redesign the report, how do I determine
the "worst case maximum settings"? This application is
distributed to a wide customer base.

I use the same criteria as my form sizes. I pick a reasonable standard.

For forms I design so they fit on a screen running 800 by 600 resolution.
For reports I use margins of 1/2 inch on all but the bottom (portrait)
where I use .65 inches. I figure that anyone whose equipment can't support
those settings either needs to upgrade or not use my application.

You say it is already "as small as it can be". Wouldn't a "size to fit"
feature make it even smaller on these problem printers? If so then you
should be able to make it smaller in the first place.
 
When I say "the report is as small as it can be" I mean
that I have taken out as much white space as possible and
made the margins as large as possible to accomodate all of
the controls needed for the report. I haven't tried
changing the control's font size to make the report
smaller. I am mostly using the standard font of 8. Any
other font seems pretty small.

I thought the 'size to fit' feature would make the font
smaller automatically on the exceptional printer that
could not handle the normal font.

The report currently has margins of .5. You said you
usually design for .65 bottom margin. So far, that is the
margin on the printers that have a problem with my report.
However,the application has currently only been
distributed to a small beta customer base. Do you think
that is the most common margin for the printers that would
be the exception? If so, maybe I can squeeze that much
more space out of the report.

Jean
 
Jean said:
When I say "the report is as small as it can be" I mean
that I have taken out as much white space as possible and
made the margins as large as possible to accomodate all of
the controls needed for the report. I haven't tried
changing the control's font size to make the report
smaller. I am mostly using the standard font of 8. Any
other font seems pretty small.

I thought the 'size to fit' feature would make the font
smaller automatically on the exceptional printer that
could not handle the normal font.

The report currently has margins of .5. You said you
usually design for .65 bottom margin. So far, that is the
margin on the printers that have a problem with my report.
However,the application has currently only been
distributed to a small beta customer base. Do you think
that is the most common margin for the printers that would
be the exception? If so, maybe I can squeeze that much
more space out of the report.

My experience has been that older printers (ink-jets mostly) sometimes have a
larger bottom margin maximum. The largest I have seen so far is .65, but there
could be others that are worse I suppose. Some in our Engineering department
have a plotter as their default printer and its maximums are outrageous
(something near 3/4 of an inch).

Newer printers are going closer to the edges and many ink-jets capable of doing
photo-quality printing actually go right to the edges of the paper. If you
really need a report to work on a large, diverse, audience then you have to
design with generous margins.
 
Thanks for the help. I'll see if I can squeeze enough
space out to get the margin to .65. Hopefully, that will
take care of the majority of the situations.
 
Back
Top