text box to set print copies? (1 Viewer)

Sneale

New member
Local time
Today, 03:16
Joined
Aug 26, 2019
Messages
26
Hello, I have a report that I need to be able to adjust the qty of the copies printed using a textbox on my form. I have the below code that works flawlessly for a set amount of copies. sometimes I will need to print 1 copy and sometimes I will need to print 2,3,4,5 etc. the text box on my form I need to reference to get the number of copies is named SkidCount What do I need to change in the code to reference the text box, and where do I need to place it?


Code:
Private Sub btnPrintHOTTAG_Click()




Const MESSAGETEXT = "No current record."
Dim strCriteria As String


strCriteria = "ID = " & Me.ID


If Not IsNull(Me.ID) Then
    ' ensure current record is saved
    Me.Dirty = False
    ' open report in print preview
    'DoCmd.OpenReport "rptHOT", _
                WhereCondition:=strCriteria
          DoCmd.OpenQuery "qryUpdateRecord", acViewNormal
          DoCmd.OpenReport "rptHOT", acViewPreview, , strCriteria
DoCmd.PrintOut , , , , 3
DoCmd.Close
DoCmd.GoToRecord , , acNewRec


    
Else
    MsgBox MESSAGETEXT, vbExclamation, "Invalid Operation"
End If
End Sub



Thanks in advance

Steve
 

Gasman

Enthusiastic Amateur
Local time
Today, 07:16
Joined
Sep 21, 2011
Messages
14,050
Use a loop for the number of copies.
Refer to your SkidCount for that number.
Not sure what the query is for, but report should be in loop.
 

Users who are viewing this thread

Top Bottom