Print blank lines in report to fill page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This was posted earlier but under a different forum. I got an answer, but it
was code from Access 97, and I couldn't convert. (My access skills are self
taught and infrequently used...so be gentle).

I want to generate a report, but after the data is completed I want the page
to fill (complete) with blank lines (in the format of the report itself), .
I don't want to have records print and then stop, the blank lines allows for
manual entry after report printed.

Is this a bigger task than expected or is there a simple fix.
 
MJBLeaningAccess said:
This was posted earlier but under a different forum. I got an answer, but it
was code from Access 97, and I couldn't convert. (My access skills are self
taught and infrequently used...so be gentle).

I want to generate a report, but after the data is completed I want the page
to fill (complete) with blank lines (in the format of the report itself), .
I don't want to have records print and then stop, the blank lines allows for
manual entry after report printed.

Is this a bigger task than expected or is there a simple fix.


Simple depends on how much you know, so you may find it
intimidating (which not a reason to abandon an idea). The
simple answer is to use the report's Page event to draw the
lines using the Line method.

I'll bet that's pretty much the answer you got in your
earlier thread and any code from A97 should work fine in a
later version. I suggest that you break it down into simple
steps (e.g. print only one line) and when something "doesn't
work" tell us what your code is and what result it produced.
 
My original report is more of a FORM that is a gride of spaces, to be
manually completed. The top of the form is populated with information from
the data base. I want to go to the next level and have data from the data
base complete this form. I have been successful, with fields being printed,
and horizontal and vertical lines being drawn to separate the various fields
of data. My question is how to complete the page with blank "grid-lines" to
the end of the page....whatever is required....sometimes 2 lines worth,
sometimes 20lines worth.

In either case....I will play around with getting lines drawn with code and
see if it moves me in the direction needed.

Thank you
 
The trick to drawing lines in the Page event procedure is to
figure out where to start and when to stop. I would need
more detailed information to be specific, but I think maybe
you will need to keep track of where the last detail is
printed on the page. Do this by creating a module level
variable (named lngPos) and setting it in the detail
section's Print event procedure:
lngPos = Me.Top + Me.Section(0).Height

Since every detail will overwrite that value, when you get
to the Page event, it will contain the vertical position of
the bottom of the last detail on the page.

Then, I think this simple, untested examplecode will get you
started:

For lngPos = lngPos + 720 To 10*1440 Step 720
Me.Line(0,lngPos)-Step(Me.Width,0)
Next lngPos

The 10 represents the bottom of the page in inches and the
720 (1/2 inch) is the amount of space you want between the
lines. change these according to your specific needs.
 
Marshall:

Thank you for your patience and feedback. I tried your suggested code, but
got a compilation error. To be honest, I am (at this point) a bit over my
head. I was hoping I did not have to do code....to this point I have limped
by with macros and ready made commands in access. I will need to pull a
basic book out to understand how to utilize the created module properly. It
appears to be very second nature to you...but I need to get a basis set for
my understanding.

Thank you again for your posting and suggestions.

Marshall Barton said:
The trick to drawing lines in the Page event procedure is to
figure out where to start and when to stop. I would need
more detailed information to be specific, but I think maybe
you will need to keep track of where the last detail is
printed on the page. Do this by creating a module level
variable (named lngPos) and setting it in the detail
section's Print event procedure:
lngPos = Me.Top + Me.Section(0).Height

Since every detail will overwrite that value, when you get
to the Page event, it will contain the vertical position of
the bottom of the last detail on the page.

Then, I think this simple, untested examplecode will get you
started:

For lngPos = lngPos + 720 To 10*1440 Step 720
Me.Line(0,lngPos)-Step(Me.Width,0)
Next lngPos

The 10 represents the bottom of the page in inches and the
720 (1/2 inch) is the amount of space you want between the
lines. change these according to your specific needs.
--
Marsh
MVP [MS Access]

My original report is more of a FORM that is a gride of spaces, to be
manually completed. The top of the form is populated with information from
the data base. I want to go to the next level and have data from the data
base complete this form. I have been successful, with fields being printed,
and horizontal and vertical lines being drawn to separate the various fields
of data. My question is how to complete the page with blank "grid-lines" to
the end of the page....whatever is required....sometimes 2 lines worth,
sometimes 20lines worth.

In either case....I will play around with getting lines drawn with code and
see if it moves me in the direction needed.
 
Unfortunately, I can't think of another way to get the
effect you want.

If you posted a Copy/Paste of the report's module, maybe I
could spot whatever is causing trouble?
 
Marshall,

I am sure you are on the right tract, it is I have to get the symantec on
"modules" and event codes.

I placed the code your suggested in the EVENT procedure in the ON PAGE
section of the report. I do need to pull out my "basic" reference on modules
and events, etc.

At present the report had not modules attached until I added one. It was an
access created report. It produces the information I want, I simply want to
tweak the report to become even more useful, thus the request for how to
complete the page (fill the page) with blank "grid-lines" after data has
printed.

Thank you again.......slow and steady is the progress

Mike

Marshall Barton said:
Unfortunately, I can't think of another way to get the
effect you want.

If you posted a Copy/Paste of the report's module, maybe I
could spot whatever is causing trouble?
--
Marsh
MVP [MS Access]

Thank you for your patience and feedback. I tried your suggested code, but
got a compilation error. To be honest, I am (at this point) a bit over my
head. I was hoping I did not have to do code....to this point I have limped
by with macros and ready made commands in access. I will need to pull a
basic book out to understand how to utilize the created module properly. It
appears to be very second nature to you...but I need to get a basis set for
my understanding.
 
MJBLeaningAccess said:
I am sure you are on the right tract, it is I have to get the symantec on
"modules" and event codes.

I placed the code your suggested in the EVENT procedure in the ON PAGE
section of the report. I do need to pull out my "basic" reference on modules
and events, etc.

At present the report had not modules attached until I added one. It was an
access created report. It produces the information I want, I simply want to
tweak the report to become even more useful, thus the request for how to
complete the page (fill the page) with blank "grid-lines" after data has
printed.


I understand, but I still need to see the code you are
actually trying to use. Please use Copy/Paste to post all
the code that you have in the report's module. This will be
mech easier if you make sure that you have checked Default
to Full Module View in the Tools - Options menu item.

Also include the exact error message you get when you use
the Debug - Compile menu item.
 
Back
Top