We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Private Sub BtnLabel_Click() Dim stDocName As String Dim MyInv As Long, MyVar As Variant Dim NumCopies, i On Error GoTo Err_Btn1_Click stDocName = "ShipLabel3x5" MyInv = Me.InvoiceID MyVar = InputBox("How many labels to print?", "Label Counter", "1") If Nz(MyVar, "") = "" Then 'cancel Exit Sub Else NumCopies = MyVar End If 'just this invoice DoCmd.OpenReport stDocName, acViewPreview, , "InvoiceID=" & MyInv For i = 1 To NumCopies DoCmd.PrintOut Next i DoCmd.Close acReport, stDocName Exit Sub Exit_Btn1_Click: Exit Sub Err_Btn1_Click: If Err.Number <> 2501 Then MsgBox "Error #" & Str(Err.Number) & vbNewLine & "An error has occurred." & vbNewLine & "Description:" & vbNewLine & ErrDesc Resume Exit_Btn1_Click End If
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.