Greetings all, I have a form I've created that automatically increments ticket numbers. What I'm trying to achieve is the user opens the form and clicks on a button to "Print Tickets."
A form opens:
What I'm trying to achieve is from the form, the user is asked how many pages of tickets to print out. The response is typed into a textbox and when the OK button is clicked:
Basically each time a print is done I want to lower the number "PagesToPrint" variable by one, autoincrement the numbers by 5 (NextTicketNum) and then rerun the print command. This loops until the "PagesToPrint" cell is at 0.
Any suggestions on how to better do this or fix my code?
A form opens:
Code:
frmticketpages.Show
What I'm trying to achieve is from the form, the user is asked how many pages of tickets to print out. The response is typed into a textbox and when the OK button is clicked:
Code:
Private Sub cmdok_Click()
Dim PagesToPrint As Integer
Do Until ActiveCell.Value = 0
Application.Goto Reference:="printpages"
ActiveCell.Value = txtnoofpages.Value
ActiveCell.Value = PagesToPrint
MsgBox = PagesToPrint.Value
If PagesToPrint > 0 Then
' Run "Print_Me"
Run "NextTicketNum"
Run "CopyTicketNum"
Application.Goto Reference:="printpages"
PagesToPrint = PagesToPrint - 1
Else
Loop
Unload Me
End Sub
Basically each time a print is done I want to lower the number "PagesToPrint" variable by one, autoincrement the numbers by 5 (NextTicketNum) and then rerun the print command. This loops until the "PagesToPrint" cell is at 0.
Any suggestions on how to better do this or fix my code?