Drawing horizontal lines in Detail Area (Access 2003 xp sp3)

A

Allan Belcher

I have a report that we will use as a job card with a fixed header and
footer size and a sub header of variable size. (Can grow to fit multiple
items on the to-do list) What I want to do is generate horizontal lines
for writing on 1cm apart in the detail section. How can the size of the
detail section be calculated.

I have in mind to create Do / Until loop that generates the lines at 1cm
spaces until it runs out of space. I just don't know how to determine
the size of the detail space per page.

Thought - A standard page will be a set height. Can I call the height of
each header and footer, subtract it from the total height and then set
the detail height to the result and then use that result as the max
height in my Do/Until loop?
 
M

Marshall Barton

Allan said:
I have a report that we will use as a job card with a fixed header and
footer size and a sub header of variable size. (Can grow to fit multiple
items on the to-do list) What I want to do is generate horizontal lines
for writing on 1cm apart in the detail section. How can the size of the
detail section be calculated.

I have in mind to create Do / Until loop that generates the lines at 1cm
spaces until it runs out of space. I just don't know how to determine
the size of the detail space per page.

Thought - A standard page will be a set height. Can I call the height of
each header and footer, subtract it from the total height and then set
the detail height to the result and then use that result as the max
height in my Do/Until loop?


How tall is the detail section?

Can the detail section grow?

Will there be more than one detail record in the report or
on a page?

FYI:
You can use the detail section's Print event to set a module
level variable to Me.TOP + Me.Height
Thenm when the Page event is run, you can use the variable
as the bottom of the last detail on the page. The bottom of
the page is the paper height less the bottom margin and the
page footer height.
 
A

Allan Belcher

Marshall said:
How tall is the detail section?

Can the detail section grow?

Will there be more than one detail record in the report or
on a page?

FYI:
You can use the detail section's Print event to set a module
level variable to Me.TOP + Me.Height
Thenm when the Page event is run, you can use the variable
as the bottom of the last detail on the page. The bottom of
the page is the paper height less the bottom margin and the
page footer height.
Marshal,

The detail area actually has nothing in it.

Page header - nothing

Job header - all relevant job information. Set to Can Grow

Detail - nothing. Lines to go in here. Set to Can grow & Can Shrink

Page Footer - generic wording

This report will print as a single page which is then photocopied onto
card. This becomes the job card that goes with the material around the
workshop. The various operations required are hand written onto the
lined detail section.

We were using a form with a graphic of the layout as the background but
found that we were limited to the number of lines that would fit into
the listing area, so I am trying to turn it into a report. The item
space now grows as needed, I just need to be able to print lines for
hand writing on.

Hope this makes sense.

Regards,

Allan
 
M

Marshall Barton

Allan said:
The detail area actually has nothing in it.

Page header - nothing

Job header - all relevant job information. Set to Can Grow

Detail - nothing. Lines to go in here. Set to Can grow & Can Shrink

Page Footer - generic wording

This report will print as a single page which is then photocopied onto
card. This becomes the job card that goes with the material around the
workshop. The various operations required are hand written onto the
lined detail section.

We were using a form with a graphic of the layout as the background but
found that we were limited to the number of lines that would fit into
the listing area, so I am trying to turn it into a report. The item
space now grows as needed, I just need to be able to print lines for
hand writing on.


So all you need to know is where the jpb header ends. Then
the page event can start drawing the lines below that.

Use code along these lines:

Private Const SPACING As Long = 555 'twips
Dim JobBottom As Long

Sub JobHeader_Print(..,
JobBottom = Me.Top + Me.Height
End Sub

Sub Report_Page()
Dim pos As Long

For pos = JobBottom + SPACING To <paper height minus
bottom margin minus Me.Section(4).Height> Step SPACING

Me.Line (0,pos)-Step(Me.Width,0)
Next pos
End Sub
 
A

Allan Belcher

Marshall said:
So all you need to know is where the jpb header ends. Then
the page event can start drawing the lines below that.

Use code along these lines:

Private Const SPACING As Long = 555 'twips
Dim JobBottom As Long

Sub JobHeader_Print(..,
JobBottom = Me.Top + Me.Height
End Sub

Sub Report_Page()
Dim pos As Long

For pos = JobBottom + SPACING To <paper height minus
bottom margin minus Me.Section(4).Height> Step SPACING

Me.Line (0,pos)-Step(Me.Width,0)
Next pos
End Sub

Marshall,

Thanks for the help. I was able to use your code and adapt it to get
just what I wanted.

Regards,

Allan
 
L

LaVerne Tyler

Hi,
I need to do the same thing, more or less, but need more detail on the code. My detail section will have data in it, I want to print horizontal lines to finish out the page.

Thanks for your help



Marshall Barton wrote:

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
05-Aug-08

Allan Belcher wrote:



So all you need to know is where the jpb header ends. Then
the page event can start drawing the lines below that.

Use code along these lines:

Private Const SPACING As Long = 555 'twips
Dim JobBottom As Long

Sub JobHeader_Print(..,
JobBottom = Me.Top + Me.Height
End Sub

Sub Report_Page()
Dim pos As Long

For pos = JobBottom + SPACING To <paper height minus
bottom margin minus Me.Section(4).Height> Step SPACING

Me.Line (0,pos)-Step(Me.Width,0)
Next pos
End Sub

--
Marsh
MVP [MS Access]

Previous Posts In This Thread:

Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
I have a report that we will use as a job card with a fixed header and
footer size and a sub header of variable size. (Can grow to fit multiple
items on the to-do list) What I want to do is generate horizontal lines
for writing on 1cm apart in the detail section. How can the size of the
detail section be calculated.

I have in mind to create Do / Until loop that generates the lines at 1cm
spaces until it runs out of space. I just don't know how to determine
the size of the detail space per page.

Thought - A standard page will be a set height. Can I call the height of
each header and footer, subtract it from the total height and then set
the detail height to the result and then use that result as the max
height in my Do/Until loop?

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
Allan Belcher wrote:



How tall is the detail section?

Can the detail section grow?

Will there be more than one detail record in the report or
on a page?

FYI:
You can use the detail section's Print event to set a module
level variable to Me.TOP + Me.Height
Thenm when the Page event is run, you can use the variable
as the bottom of the last detail on the page. The bottom of
the page is the paper height less the bottom margin and the
page footer height.

--
Marsh
MVP [MS Access]

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
Marshall Barton wrote:
Marshal,

The detail area actually has nothing in it.

Page header - nothing

Job header - all relevant job information. Set to Can Grow

Detail - nothing. Lines to go in here. Set to Can grow & Can Shrink

Page Footer - generic wording

This report will print as a single page which is then photocopied onto
card. This becomes the job card that goes with the material around the
workshop. The various operations required are hand written onto the
lined detail section.

We were using a form with a graphic of the layout as the background but
found that we were limited to the number of lines that would fit into
the listing area, so I am trying to turn it into a report. The item
space now grows as needed, I just need to be able to print lines for
hand writing on.

Hope this makes sense.

Regards,

Allan

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
Allan Belcher wrote:



So all you need to know is where the jpb header ends. Then
the page event can start drawing the lines below that.

Use code along these lines:

Private Const SPACING As Long = 555 'twips
Dim JobBottom As Long

Sub JobHeader_Print(..,
JobBottom = Me.Top + Me.Height
End Sub

Sub Report_Page()
Dim pos As Long

For pos = JobBottom + SPACING To <paper height minus
bottom margin minus Me.Section(4).Height> Step SPACING

Me.Line (0,pos)-Step(Me.Width,0)
Next pos
End Sub

--
Marsh
MVP [MS Access]

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
Marshall Barton wrote:

Marshall,

Thanks for the help. I was able to use your code and adapt it to get
just what I wanted.

Regards,

Allan


Submitted via EggHeadCafe - Software Developer Portal of Choice
How to display a Gravatar Image with 100 Percent Client Script Code
http://www.eggheadcafe.com/tutorial...c-b0877c10ecb4/how-to-display-a-gravatar.aspx
 
D

Duane Hookom

You can use the Line method to draw lines on the On Page event of the
report. The following code will draw up to 24 rectangles the same size as
the detail section. You can modify the code to change the intTopMargin. This
will fill the entire page with lines.

Private Sub Report_Page()
Dim intRows As Integer
Dim intLoop As Integer
Dim intTopMargin As Integer
Dim intDetailHeight As Integer
intRows = 24
intDetailHeight = Me.Section(0).Height
intTopMargin = 360
For intLoop = 0 To intRows
Me.CurrentX = 20
Me.CurrentY = intLoop * intDetailHeight + intTopMargin
Me.Line (0, intLoop * intDetailHeight + intTopMargin)- _
Step(Me.Width, intDetailHeight), , B
Next
End Sub

--
Duane Hookom
MS Access MVP

Hi,
I need to do the same thing, more or less, but need more detail on the
code. My detail section will have data in it, I want to print horizontal
lines to finish out the page.

Thanks for your help



Marshall Barton wrote:

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
05-Aug-08

Allan Belcher wrote:



So all you need to know is where the jpb header ends. Then
the page event can start drawing the lines below that.

Use code along these lines:

Private Const SPACING As Long = 555 'twips
Dim JobBottom As Long

Sub JobHeader_Print(..,
JobBottom = Me.Top + Me.Height
End Sub

Sub Report_Page()
Dim pos As Long

For pos = JobBottom + SPACING To <paper height minus
bottom margin minus Me.Section(4).Height> Step SPACING

Me.Line (0,pos)-Step(Me.Width,0)
Next pos
End Sub

--
Marsh
MVP [MS Access]

Previous Posts In This Thread:

Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
I have a report that we will use as a job card with a fixed header and
footer size and a sub header of variable size. (Can grow to fit multiple
items on the to-do list) What I want to do is generate horizontal lines
for writing on 1cm apart in the detail section. How can the size of the
detail section be calculated.

I have in mind to create Do / Until loop that generates the lines at 1cm
spaces until it runs out of space. I just don't know how to determine
the size of the detail space per page.

Thought - A standard page will be a set height. Can I call the height of
each header and footer, subtract it from the total height and then set
the detail height to the result and then use that result as the max
height in my Do/Until loop?

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
Allan Belcher wrote:



How tall is the detail section?

Can the detail section grow?

Will there be more than one detail record in the report or
on a page?

FYI:
You can use the detail section's Print event to set a module
level variable to Me.TOP + Me.Height
Thenm when the Page event is run, you can use the variable
as the bottom of the last detail on the page. The bottom of
the page is the paper height less the bottom margin and the
page footer height.

--
Marsh
MVP [MS Access]

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
Marshall Barton wrote:
Marshal,

The detail area actually has nothing in it.

Page header - nothing

Job header - all relevant job information. Set to Can Grow

Detail - nothing. Lines to go in here. Set to Can grow & Can Shrink

Page Footer - generic wording

This report will print as a single page which is then photocopied onto
card. This becomes the job card that goes with the material around the
workshop. The various operations required are hand written onto the
lined detail section.

We were using a form with a graphic of the layout as the background but
found that we were limited to the number of lines that would fit into
the listing area, so I am trying to turn it into a report. The item
space now grows as needed, I just need to be able to print lines for
hand writing on.

Hope this makes sense.

Regards,

Allan

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
Allan Belcher wrote:



So all you need to know is where the jpb header ends. Then
the page event can start drawing the lines below that.

Use code along these lines:

Private Const SPACING As Long = 555 'twips
Dim JobBottom As Long

Sub JobHeader_Print(..,
JobBottom = Me.Top + Me.Height
End Sub

Sub Report_Page()
Dim pos As Long

For pos = JobBottom + SPACING To <paper height minus
bottom margin minus Me.Section(4).Height> Step SPACING

Me.Line (0,pos)-Step(Me.Width,0)
Next pos
End Sub

--
Marsh
MVP [MS Access]

Re: Drawing horizontal lines in Detail Area (Access 2003 xp sp3)
Marshall Barton wrote:

Marshall,

Thanks for the help. I was able to use your code and adapt it to get
just what I wanted.

Regards,

Allan


Submitted via EggHeadCafe - Software Developer Portal of Choice
How to display a Gravatar Image with 100 Percent Client Script Code
http://www.eggheadcafe.com/tutorial...c-b0877c10ecb4/how-to-display-a-gravatar.aspx
 

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