Print more than one label

S

Shannon

I used the following code (which I received at this
newsgroup site) to prompt users to input the number of
labels to skip when a sheet of labels had some used
already. Now I would like to prompt users to input the
number of labels to print when more than one is desired. I
am not familiar with exactly what the code is doing to be
able to modify what I was given. Any help is appreciated.

Add Report Header to label report.
Add 2 test boxes to the Header.
1) Name one SkipControl
Leave it's control source unbound.

2) Name the other SkipCounter
Set its control source to =[Skip How Many?]

Now code the Report Header Format event as below:
Private Sub ReportHeader_Format(Cancel As Integer,
FormatCount As Integer)
[SkipControl] = "Skip"
Cancel = True
End Sub
============
Next code the Detail OnPrint event:
Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)
If PrintCount <= [SkipCounter] And [SkipControl] = "Skip"
Then
Me. NextRecord = False
Me. PrintSection = False
Else
[SkipControl] = "No"
Me.PrintSection = True
Me.NextRecord = True
End If

End Sub
========

Thanks,
Shannon
 
F

fredg

I used the following code (which I received at this
newsgroup site) to prompt users to input the number of
labels to skip when a sheet of labels had some used
already. Now I would like to prompt users to input the
number of labels to print when more than one is desired. I
am not familiar with exactly what the code is doing to be
able to modify what I was given. Any help is appreciated.
Thanks,
Shannon
Shannon,
This incorporates the previous code:

This will permit you to enter the number of times to repeat the
labels, as well as skip missing label positions on an already used
sheet.

First make sure your label report properly prints 1 label per record.

Then add a Report Header to the label report.
Add 3 unbound text boxes to the header.
1) Set the Control Source to:
= [Skip how many]
Name this control SkipCounter
2) Leave the second control unbound.
Name this control SkipControl
3) Set the third control's Control Source to:
=[Repeat how many]
Name it RepeatCounter

Next code the Report Header OnFormat event:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
[SkipControl] = "Skip"
Cancel = True
End Sub
=======
Now code the Detail OnPrint Event:
(Note that intMyPrint is Static!!)

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Static intMyPrint As Integer
If PrintCount <= [SkipCounter] And [SkipControl] = "Skip" Then
Me.NextRecord = False
Me.PrintSection = False
intMyPrint = 0
Else
[SkipControl] = "No"
Me.PrintSection = True
Me.NextRecord = True
intMyPrint = intMyPrint + 1
If IsNull([RepeatCounter]) Then
ElseIf intMyPrint Mod [RepeatCounter] = 0 Then
Me.NextRecord = True
intMyPrint = 0
Else
Me.NextRecord = False
End If
End If

End Sub
=========

When you run the report, it will ask how many labels to skip, then how
many times to repeat each label.

Hope this has helped.
 

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