I need to be able to allow the user to cancel a print job.
The form allows the user to click a print button to print out multiple reports. Actually it gets the data from the DB and puts into the word form then prints it out.. It continues thru the recordset until all the Reports are printed.
I need to have the user be able to click on the Cancel button on the form but I can not seem to be able to make the button active.
When the user selects print (cmdPrint_Click)
I make the cancel print button visible.
but the button is not active on the form..
I have tried to set focus the button but it still does not allow the button to work.. I am assuming it is because I am in the cmdPrint_click event??
I don't want to use a msgbox because if the user is printing out 100 reports this forces the user to click OK to continue each time... They did not like that idea..
Here is my code:
CancelPrint is a global that is set to true in the cmdCancel_click event.
The Print_Quad_Chart_FY05 send the data to a word form to be printed out.
-------------------------------------------------------
-----------------------------------------------------------
Me.cmdCancel.SetFocus Did NOT Work...
Any suggestions would help..
Yes, I tried to search but it was down..
Thanks
Alley
The form allows the user to click a print button to print out multiple reports. Actually it gets the data from the DB and puts into the word form then prints it out.. It continues thru the recordset until all the Reports are printed.
I need to have the user be able to click on the Cancel button on the form but I can not seem to be able to make the button active.
When the user selects print (cmdPrint_Click)
I make the cancel print button visible.
but the button is not active on the form..
I have tried to set focus the button but it still does not allow the button to work.. I am assuming it is because I am in the cmdPrint_click event??
I don't want to use a msgbox because if the user is printing out 100 reports this forces the user to click OK to continue each time... They did not like that idea..
Here is my code:
CancelPrint is a global that is set to true in the cmdCancel_click event.
The Print_Quad_Chart_FY05 send the data to a word form to be printed out.
-------------------------------------------------------
Code:
cmdPrint_Click()
Me.cmdCancel.Visible = True
.
.
.
Do While Not rst.EOF
Me.cmdCancel.SetFocus
If CancelPrint Then
okcan = MsgBox("Press Cancel to Stop Printing", vbOKCancel)
If okcan = vbCancel Then
Exit Do
End If
End If
Call Print_Quad_Chart_FY05(NZ(rst("Quad_id").value, 0), True, pfile, pout, copies)
rst.MoveNext
Loop
Me.cmdCancel.SetFocus Did NOT Work...
Any suggestions would help..
Yes, I tried to search but it was down..
Thanks
Alley