how to print extra blank records

G

Guest

I have a membership database, from which I print membership cards, using a
two-column report printing onto standard Avery business card stock (10
cards/page). If the number of cards to be printed is not an even multiple of
10, there are blank cards at the bottom of the last page. Is it possible to
fill the last page with blank membership cards (i.e. include the organization
info, which is hard-coded in the report, and leave the member info, which
comes from the databae, blank), instead of completely blank cards?
 
B

Bob Howard

Kinda hokey but...

1) Set up a report footer for 9 "blank" cards as 9 separate controls with a
meaningful name on each (BlankCard1 through BlankCard9. Set all dummy cards
to visible=yes. Set the footer to canshrink=yes.

2) In an onprint event for the detail, count the number of cards you are
actually printing. Save this counter in a global variable (or somewhere
you'll have access to it for each detail record and again later when the
footer formats).

3) In a onformat event for the report footer, fetch the counter. Do a
calculation to see how many of the 9 dummy cards are needed. You're after
the remainder after dividing the couonter by 10. If the # printed is
exactly a multiple of 10 the remainder would be zero and you won't need any
.... etc.

4) Still in the onformat event for the report footer, make the appropriate
number of dummy cards visible=false.

Hey --- it's worth a shot!

Bob.
 
D

Duane Hookom

You can do almost all of your printing of text and lines using the Print and
Line methods of the report. The following code in the On Page event of the
report, draws 24 lines and prints a number at the left of each line. You
could modify the code to draw repeating lines and text anywhere on the page.

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
Me.FontSize = 16
For intLoop = 0 To intRows
Me.CurrentX = 20
Me.CurrentY = intLoop * intDetailHeight + intTopMargin
Me.Print intLoop + 1
Me.Line (0, intLoop * intDetailHeight + intTopMargin)- _
Step(Me.Width, intDetailHeight), , B
Next
End Sub
 
G

Guest

Thanks Bob. It looks like it should work.

After I posted this problem, a possible solution occurred to me.

1) Insert 9 dummy records, which will not be selected by the report, into
the database.
2) In the OnOpen event, count the number of cards to be printed, calculate
the number of extra records needed, and update the appropriate number of
dummy records so they will be selected.
3) In the controls that print the member data, edit the dummy data, as needed.
4) In the OnClose event, reset the dummy records.

Does this look feasible?

....Larry Allen
 
G

Guest

Thanks Duane.

....Larry Allen

Duane Hookom said:
You can do almost all of your printing of text and lines using the Print and
Line methods of the report. The following code in the On Page event of the
report, draws 24 lines and prints a number at the left of each line. You
could modify the code to draw repeating lines and text anywhere on the page.

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
Me.FontSize = 16
For intLoop = 0 To intRows
Me.CurrentX = 20
Me.CurrentY = intLoop * intDetailHeight + intTopMargin
Me.Print intLoop + 1
Me.Line (0, intLoop * intDetailHeight + intTopMargin)- _
Step(Me.Width, intDetailHeight), , B
Next
End Sub
 
B

Bob Howard

Should work, but would require some fancy SQL coding in the OnOpen event.
Bob.
 

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