Bordering for Report

  • Thread starter Agnelo Fernandes
  • Start date
A

Agnelo Fernandes

I have designed a report which is a certificate for candidates atteneding a 1
day course. It has page header, details and page footer. I am using the page
header and footer for logos and page details for candidate details.

I need to draw a page border continuously across the page header, details
and page footer. Basically, the page border should border all the information
in the page.

Could anyone help please?
 
M

Marshall Barton

Agnelo said:
I have designed a report which is a certificate for candidates atteneding a 1
day course. It has page header, details and page footer. I am using the page
header and footer for logos and page details for candidate details.

I need to draw a page border continuously across the page header, details
and page footer. Basically, the page border should border all the information
in the page.


Use the report's Page event. I this will draw the border at
the report's margins:

Me.Line (0,0)-Step(Me.Width,Me.ScaleHeight), , B
 
D

Duane Hookom

You can use code in the On Page event of your report like:
Private Sub Report_Page()
Dim lngTop As Long
Dim lngLeft As Long
Dim lngBottom As Long
Dim lngRight As Long
Dim i As Integer
Dim intBorderCount As Integer
lngTop = 0
lngLeft = 0
lngBottom = 12000
lngRight = Me.Width
intBorderCount = 20 'set to 1 for just the outside border

For i = 1 To intBorderCount
Me.DrawWidth = i
Me.Line (lngLeft, lngTop)-(lngRight, lngBottom), , B
lngLeft = lngLeft + i * 5
lngRight = lngRight - i * 5
lngTop = lngTop + i * 5
lngBottom = lngBottom - i * 5
Next
End Sub
 
A

Agnelo Fernandes

Thanks a lot Duane. I currently have it set black in colour based on your
programming. Can I possibly turn it to Magenta Red ?
 
A

Agnelo Fernandes

Thanks a lot for the help.

Marshall Barton said:
Use the report's Page event. I this will draw the border at
the report's margins:

Me.Line (0,0)-Step(Me.Width,Me.ScaleHeight), , B
 
D

Duane Hookom

You can set the ForeColor with a line of code like:
Me.ForeColor = RGB(255, 0, 125)
You can add this line prior to the For i = ...
Change the numbers inside RGB() to change the color. You can also use:
Me.ForeColor = 16711935
 

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