View Single Post
  #2  
Old July 30th, 2007, 09:14 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Rounded Rectangle

Vayse wrote:
I need to insert rounded rectangles on an access report. To see what I mean,
open Paint, and selected rounded rectangles from the toolbox.
These rectangles are to be in the report header, footer, and body.
For the header and footer, I just drew the rectangle in paint, then pasted
into access. Works ok, as the footer and header stay the same size.
however, the body of the report changes size depending on the page. Some
sections are longer than others.
I don't want to have to draw a new rectangle for each page. Bit painful. I
tried just copying the 'roundy' bits, then lining up with an access
rectangle, but its very painful.



As you've found, Access does not have a setting for rounded
rectangles. However you can use a report's Print event with
the Line and Circle methods to draw all kinds of things.

Here's some code that draws a rounded rectangle around a
text box on a report:

Const R As Long = 100
Const Pi As Double = 3.14159265

Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)
Me.ForeColor = vbGreen
Me.DrawWidth = 20

With Me.txtRefNum
Me.Line (.Left, .Top + R)-(.Left, .Top + .Height - R)
Me.Circle (.Left + R, .Top + R), R, , 0.5 * Pi, Pi
Me.Line (.Left + R, .Top)-(.Left + .Width - R, .Top)
Me.Circle (.Left + .Width - R, .Top + R), R, , 0, 0.5 *
Pi
Me.Line (.Left + .Width, .Top + R)-(.Left + .Width, .Top
+ .Height - R)
Me.Circle (.Left + .Width - R, .Top + .Height - R), R, ,
1.5 * Pi, 2 * Pi
Me.Line (.Left + R, .Top + .Height)-(.Left + .Width - R,
..Top + .Height)
Me.Circle (.Left + R, .Top + .Height - R), R, , Pi, 1.5
* Pi
End With

End Sub

--
Marsh
MVP [MS Access]