I have a following situation.
Form1 runs a printing routine after clicking OK.
Then Modeless form Form2 shows up with info what is being printed now.
I need a cancel button on Modeless form Form2 to stop all remaining tasks and exit.
At the moment cancel button in Form2 I have cannot be clicked when printing job is being done, so don't even know if End I have will work to stop procedures running .
A simplified version of what I have:
In Form1 - OK Button:
In Form2 - Cancel button:
Form1 runs a printing routine after clicking OK.
Then Modeless form Form2 shows up with info what is being printed now.
I need a cancel button on Modeless form Form2 to stop all remaining tasks and exit.
At the moment cancel button in Form2 I have cannot be clicked when printing job is being done, so don't even know if End I have will work to stop procedures running .
A simplified version of what I have:
In Form1 - OK Button:
Code:
Private Sub ButtonOK_Click()
Me.Hide
Form2.Show
For i = 1 To ItemsQty
Form2.Label1.Caption = "Item " & i
PreparePrintout(i)
PrintToNetworkPrinter
Next i
Form2.Hide
Unload Form2
Unload Form1
End Sub
Code:
Private Sub ButtonCancel_Click()
Unload Form1
Unload Form2
End
End Sub