Access freezes when print is cancelled

K

Kurt

When I select a report and click a Print button, if I
decide to click Cancel on the automatic "Now
printing . . . " pop up form, Access freezes and stops
responding (hence, CTRL-ALT-DELETE).

I assume I can add some Exit Sub statements in the code,
but I'm not sure where or how.

Thanks. - Kurt (code below)

Code for the Print button:
-------------------------------------------
Private Sub Print_Click()
PrintReports acNormal
End Sub
-------------------------------------------

Procedure for Print_Click:
-------------------------------------------
Sub PrintReports(PrintMode As Integer)
On Error GoTo Err_Preview_Click
' This procedure used in Preview_Click and
Print_Click Sub procedures.
' Preview or print report selected in the option
group.

Dim strWhereRspnsID As String

strWhereRspnsID = "RspnsID = Forms!
[frmnuReportSelect]!cboRespondant"

Select Case Me!optSelectReport
Case 1
DoCmd.OpenReport "rptStatistics", PrintMode
Case 2
. . . etc.

End Select

Exit_Preview_Click:
Exit Sub

Err_Preview_Click:
Resume Exit_Preview_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top