printer columns

  • Thread starter Thread starter Wm
  • Start date Start date
W

Wm

Ref: Access 2k, SQL 2k

Is there an easy way in VBA to change the column count and width? I want to
adjust the number of columns for my report depending on the max width of the
stuff I'm printing.

Thanks,
William
 
William:

Yes you can do this, however, you can't really do it at run time.

You'd have to have an external function that runs before you open the report
that via a record set determines the max number of items. Then you'd open
the report in design mode and use the prtMip property of the report to set
column widths and spacing. This isn't an easy property to work with but
there are examples within the help file. After you've got the code working
great, then use the DoCmd.Echo False and DoCmd.Echo True to hide opening the
report in design mode.
 
Thanks. I'll have to explore that.

In the mean time, I thought of a very easy way to accomplish the
variable-column report. I just made multiple copies of the report, one for
each possible number of columns (3 in my case). Then I calculate which one
I need and call that report.

William
 
Back
Top