M
Miranda
I have the following code which I found in another post and it is working
great! The only problem I have is that if I skip blank labels, it skips
those labels on each page. I am using an 8 label per page set up. If I need
to skip the first 2 and print 12, how do I only skip 2 on the first page of
labels? Thanks so much for any help anyone can give me!
Option Compare Database
'*********************************************************
'Declarations section of the module.
'**********************************************************
Option Explicit
Dim LabelBlanks&
Dim LabelCopies&
Dim BlankCount&
Dim CopyCount&
'==========================================================
' The following function will cause an input box to
' display when the report is run that prompts the user
' for the number of used labels to skip and how many
' copies of each label should be printed.
'===========================================================
Function LabelSetup()
LabelBlanks& = Forms!frmNumberOfLabels!Frame1
LabelCopies& = Forms!frmNumberOfLabels!TimesToRepeatRecord
If LabelBlanks& < 0 Then LabelBlanks& = 0
If LabelCopies& < 1 Then LabelCopies& = 1
End Function
'===========================================================
'The following function sets the variables to a zero
'===========================================================
Function LabelInitialize()
BlankCount& = 0
CopyCount& = 0
End Function
'===========================================================
' The following function is the main part of this code
' that allows the labels to print as the user desires.
'===========================================================
Function LabelLayout(R As Report)
If BlankCount& < LabelBlanks& Then
R.NextRecord = False
R.PrintSection = False
BlankCount& = BlankCount& + 1
ElseIf CopyCount& < (LabelCopies& - 1) Then
R.NextRecord = False
CopyCount& = CopyCount& + 1
Else: CopyCount& = 0
End If
End Function
great! The only problem I have is that if I skip blank labels, it skips
those labels on each page. I am using an 8 label per page set up. If I need
to skip the first 2 and print 12, how do I only skip 2 on the first page of
labels? Thanks so much for any help anyone can give me!
Option Compare Database
'*********************************************************
'Declarations section of the module.
'**********************************************************
Option Explicit
Dim LabelBlanks&
Dim LabelCopies&
Dim BlankCount&
Dim CopyCount&
'==========================================================
' The following function will cause an input box to
' display when the report is run that prompts the user
' for the number of used labels to skip and how many
' copies of each label should be printed.
'===========================================================
Function LabelSetup()
LabelBlanks& = Forms!frmNumberOfLabels!Frame1
LabelCopies& = Forms!frmNumberOfLabels!TimesToRepeatRecord
If LabelBlanks& < 0 Then LabelBlanks& = 0
If LabelCopies& < 1 Then LabelCopies& = 1
End Function
'===========================================================
'The following function sets the variables to a zero
'===========================================================
Function LabelInitialize()
BlankCount& = 0
CopyCount& = 0
End Function
'===========================================================
' The following function is the main part of this code
' that allows the labels to print as the user desires.
'===========================================================
Function LabelLayout(R As Report)
If BlankCount& < LabelBlanks& Then
R.NextRecord = False
R.PrintSection = False
BlankCount& = BlankCount& + 1
ElseIf CopyCount& < (LabelCopies& - 1) Then
R.NextRecord = False
CopyCount& = CopyCount& + 1
Else: CopyCount& = 0
End If
End Function