Placing Borders on Reports

A

assyrian47

It does nbot appear to be something that can be done in Access 2003
without some code. can anyone direct me to a tutorial on how this can
be acheived?

Thanks
 
D

Duane Hookom

Good call on the solution and the opinion on recent Help. I believe the code
would only work in the On Print event since the controls' grown height can't
be determined in the On Format event.
--
Duane Hookom
Microsoft Access MVP


Marshall Barton said:
It does nbot appear to be something that can be done in Access 2003
without some code. can anyone direct me to a tutorial on how this can
be acheived?


Depends on what you wnat borders around. If its just text
boxes, then maybe the text box's BorderStyle property will
be sufficient. If you want to draw borders around a bunch
of controls, then try using a rectangle control with a
tranparent back style.

If you are trying to put borders around can grow controls or
around an entire page, then, yes, you need code. The code
needs to use the report Line method in the Format event of
the section containing the controls or the Page event where
you can draw lines all over the page. I'd like to tell you
to use Help to find out more about the Line methos, but that
help topic has been garbled since A2000.

Here's a copy (newsreader mangled) of the A97 help topic:
---------------------------------------------------------------------------------
The Line method draws lines and rectangles on a Report
object when the Print event occurs.

Syntax

object.Line [[Step](x1, y1)] – [Step](x2, y2)[, [color][,
B[F]]]

You can use this method only in an event procedure or a
macro specified by the OnPrint or OnFormat event property
for a report section, or the OnPage event property for a
report.
The Line method has the following arguments.

Argument Description
object The Report object on which the line or rectangle is
to be drawn.
Step A keyword that indicates the starting point
coordinates are relative to the current graphics position
given by the settings for the CurrentX and CurrentY
properties of the object argument.
x1, y1 Single values indicating the coordinates of the
starting point for the line or rectangle. The Scale
properties (ScaleMode, ScaleLeft, ScaleTop, ScaleHeight, and
ScaleWidth) of the Report object specified by the object
argument determine the unit of measure used. If this
argument is omitted, the line begins at the position
indicated by the CurrentX and CurrentY properties.
Step A keyword that indicates the end-point coordinates are
relative to the line's starting point.
x2, y2 Single values indicating the coordinates of the end
point for the line to draw. These arguments are required.
color A Long value indicating the RGB (red-green-blue) color
used to draw the line. If this argument is omitted, the
value of the ForeColor property is used. You can also use
the RGB function or QBColor function to specify the color.
B An option that creates a rectangle by using the
coordinates as opposite corners of the rectangle.
F F cannot be used without B. If the B option is used, the F
option specifies that the rectangle is filled with the same
color used to draw the rectangle. If B is used without F,
the rectangle is filled with the color specified by the
current settings of the FillColor and BackStyle properties.
The default value for the BackStyle property is Normal for
rectangles and lines.
Remarks

To connect two drawing lines, make sure that one line begins
at the end point of the previous line.
The width of the line drawn depends on the DrawWidth
property setting. The way a line or rectangle is drawn on
the background depends on the settings of the DrawMode and
DrawStyle properties.
When you apply the Line method, the CurrentX and CurrentY
properties are set to the end point specified by the x2 and
y2 arguments.
 
M

Marshall Barton

It does nbot appear to be something that can be done in Access 2003
without some code. can anyone direct me to a tutorial on how this can
be acheived?


Depends on what you wnat borders around. If its just text
boxes, then maybe the text box's BorderStyle property will
be sufficient. If you want to draw borders around a bunch
of controls, then try using a rectangle control with a
tranparent back style.

If you are trying to put borders around can grow controls or
around an entire page, then, yes, you need code. The code
needs to use the report Line method in the Format event of
the section containing the controls or the Page event where
you can draw lines all over the page. I'd like to tell you
to use Help to find out more about the Line methos, but that
help topic has been garbled since A2000.

Here's a copy (newsreader mangled) of the A97 help topic:
---------------------------------------------------------------------------------
The Line method draws lines and rectangles on a Report
object when the Print event occurs.

Syntax

object.Line [[Step](x1, y1)] – [Step](x2, y2)[, [color][,
B[F]]]

You can use this method only in an event procedure or a
macro specified by the OnPrint or OnFormat event property
for a report section, or the OnPage event property for a
report.
The Line method has the following arguments.

Argument Description
object The Report object on which the line or rectangle is
to be drawn.
Step A keyword that indicates the starting point
coordinates are relative to the current graphics position
given by the settings for the CurrentX and CurrentY
properties of the object argument.
x1, y1 Single values indicating the coordinates of the
starting point for the line or rectangle. The Scale
properties (ScaleMode, ScaleLeft, ScaleTop, ScaleHeight, and
ScaleWidth) of the Report object specified by the object
argument determine the unit of measure used. If this
argument is omitted, the line begins at the position
indicated by the CurrentX and CurrentY properties.
Step A keyword that indicates the end-point coordinates are
relative to the line's starting point.
x2, y2 Single values indicating the coordinates of the end
point for the line to draw. These arguments are required.
color A Long value indicating the RGB (red-green-blue) color
used to draw the line. If this argument is omitted, the
value of the ForeColor property is used. You can also use
the RGB function or QBColor function to specify the color.
B An option that creates a rectangle by using the
coordinates as opposite corners of the rectangle.
F F cannot be used without B. If the B option is used, the F
option specifies that the rectangle is filled with the same
color used to draw the rectangle. If B is used without F,
the rectangle is filled with the color specified by the
current settings of the FillColor and BackStyle properties.
The default value for the BackStyle property is Normal for
rectangles and lines.
Remarks

To connect two drawing lines, make sure that one line begins
at the end point of the previous line.
The width of the line drawn depends on the DrawWidth
property setting. The way a line or rectangle is drawn on
the background depends on the settings of the DrawMode and
DrawStyle properties.
When you apply the Line method, the CurrentX and CurrentY
properties are set to the end point specified by the x2 and
y2 arguments.
 
M

Marshall Barton

Duane said:
Good call on the solution and the opinion on recent Help. I believe the code
would only work in the On Print event since the controls' grown height can't
be determined in the On Format event.


You're mostly right aboout that, Duane. OTOH, for vertical
lines, you can draw 22" tall lines without caring about that
issue ;-)

Since I had a brain fault about which event to use, I had no
intention of bringing the tall vertical line issue into the
discussion. Unfortunately, once I made that mistake, the
issue was on the table ;-)
 

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