Hi
I posted this in the "other" section on error - sorry for the duplication.
I have code (and unfortunately it was provided by another site and I'm not sure of the author), which prompts the user to be able to skip labels at run time. The code is as follows:
Option Compare Database
Option Explicit
Dim LabelBlanks&
Dim LabelCopies&
Dim BlankCount&
Dim CopyCount&
Function LabelSetup()
LabelBlanks& = Val(InputBox$("Enter Number of blank labels to skip"
)
LabelCopies& = Val(InputBox$("Enter Number of Copies to Print"
)
If LabelBlanks& < 0 Then LabelBlanks& = 0
If LabelCopies& < 1 Then LabelCopies& = 1
End Function
Function LabelInitialize()
BlankCount& = 0
CopyCount& = 0
End Function
Function LabelLayout(R As Report)
If BlankCount& < LabelBlanks& Then
R.NextRecord = False
R.PrintSection = False
BlankCount& = BlankCount& + 1
Else
If CopyCount& < (LabelCopies& - 1) Then
R.NextRecord = False
CopyCount& = CopyCount& + 1
Else
CopyCount& = 0
End If
End If
End Function
For the report, LabelSetup() is placed in the OnOpen event of the report, LabelInitialize() is placed in the OnFormat event of the ReportHeader and LabelLayout([Reports]![ReportName]) is placed in the OnPrint Event of the Details section. This works great.
However, I have created a receipt report which uses the format of nametag inserts supplied by Avery to print on. Because it involves summary calculations, the report is created using a groupheader with the details section suppressed. Placing the LabelLayout([Reports]![ReportName]) in the GroupHeader instead of the details section doesn't work and the skip labels is ignored if left in the details section.
What do I need to do to have these functions work? Look forward to your replies!
Shelby
I posted this in the "other" section on error - sorry for the duplication.
I have code (and unfortunately it was provided by another site and I'm not sure of the author), which prompts the user to be able to skip labels at run time. The code is as follows:
Option Compare Database
Option Explicit
Dim LabelBlanks&
Dim LabelCopies&
Dim BlankCount&
Dim CopyCount&
Function LabelSetup()
LabelBlanks& = Val(InputBox$("Enter Number of blank labels to skip"
LabelCopies& = Val(InputBox$("Enter Number of Copies to Print"
If LabelBlanks& < 0 Then LabelBlanks& = 0
If LabelCopies& < 1 Then LabelCopies& = 1
End Function
Function LabelInitialize()
BlankCount& = 0
CopyCount& = 0
End Function
Function LabelLayout(R As Report)
If BlankCount& < LabelBlanks& Then
R.NextRecord = False
R.PrintSection = False
BlankCount& = BlankCount& + 1
Else
If CopyCount& < (LabelCopies& - 1) Then
R.NextRecord = False
CopyCount& = CopyCount& + 1
Else
CopyCount& = 0
End If
End If
End Function
For the report, LabelSetup() is placed in the OnOpen event of the report, LabelInitialize() is placed in the OnFormat event of the ReportHeader and LabelLayout([Reports]![ReportName]) is placed in the OnPrint Event of the Details section. This works great.
However, I have created a receipt report which uses the format of nametag inserts supplied by Avery to print on. Because it involves summary calculations, the report is created using a groupheader with the details section suppressed. Placing the LabelLayout([Reports]![ReportName]) in the GroupHeader instead of the details section doesn't work and the skip labels is ignored if left in the details section.
What do I need to do to have these functions work? Look forward to your replies!
Shelby