skip blank labels on first page only

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
 
G

Gina Whipp

I have no issues and have used this for years. How is you report set-up?
Mine is set-up as follows:

Report OnOpen should say =LabelSetup()
Report Header OnFormat say =LabelInitialize()
Detail OnPrint should say =LabelLayout([Reports]![NameOfYourReport])
 
M

Miranda

Well don't I feel silly. I was using the page header instead of the report
header. Thanks!
--
Miranda


Gina Whipp said:
I have no issues and have used this for years. How is you report set-up?
Mine is set-up as follows:

Report OnOpen should say =LabelSetup()
Report Header OnFormat say =LabelInitialize()
Detail OnPrint should say =LabelLayout([Reports]![NameOfYourReport])

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

Miranda said:
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
 
G

Gina Whipp

Your welcome...

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II
Miranda said:
Well don't I feel silly. I was using the page header instead of the
report
header. Thanks!
--
Miranda


Gina Whipp said:
I have no issues and have used this for years. How is you report set-up?
Mine is set-up as follows:

Report OnOpen should say =LabelSetup()
Report Header OnFormat say =LabelInitialize()
Detail OnPrint should say =LabelLayout([Reports]![NameOfYourReport])

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

Miranda said:
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
 

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