A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Rounded Rectangle



 
 
Thread Tools Display Modes
  #1  
Old July 30th, 2007, 01:02 PM posted to microsoft.public.access.reports
Vayse
external usenet poster
 
Posts: 11
Default Rounded Rectangle

Hi
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.

Any suggestions or tips?
Thanks
Vayse


Ads
  #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]
  #3  
Old July 31st, 2007, 10:16 AM posted to microsoft.public.access.reports
Vayse
external usenet poster
 
Posts: 11
Default Rounded Rectangle

"Marshall Barton" wrote in message
...
Vayse wrote:
I need to insert rounded rectangles on an access report. To see what I
mean,



Thanks, that code provides what I need. Great stuff.
Vayse


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004-2018 OfficeFrustration.
The comments are property of their posters.