I have been using a module for printing labels in Access 97, and
although it works fine, I would like to resolve a minor problem. The
module allows for setting the number of labels to print and/or to
skip; however, the Cancel command button does not function at all, nor
does clicking the X-close. Clicking either one is the same as clicking
the OK button. I have tried virtually everything, but to no avail.
Since the module creates and displays the input box, I assume that I
will need a piece of code to address the issue. A copy of the module
is posted below. Any assistance will be greatly appreciated. Thanks,
Dalan
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