open report action was cancelled (1 Viewer)

lehcarrodan

Registered User.
Local time
Yesterday, 21:19
Joined
Feb 20, 2017
Messages
11
Hi, so I have a button click that I want to open a report that you can then choose to save a pdf or print. If I open as below it prints automatically but when I try to open in acPreview or normal it gives an open report action was cancelled error message.
I think there's an issue because there's a prompt
Private Sub cmdForPO_Click()
Dim respo As Integer
respo = MsgBox("Would you like this invoice in English? Click No for French.", vbYesNo, "Choose Invoice Language")
If respo = vbYes Then
DoCmd.OpenReport "rptInvoiceSelectPO"
End If
If respo = vbNo Then
DoCmd.OpenReport "rptInvoiceSelectPOFr"
End If
End Sub
 

Ranman256

Well-known member
Local time
Today, 00:19
Joined
Apr 9, 2015
Messages
4,339
did you use:
docmd.OpenReport "report",acViewPreview

if you cancel the preview , you get the error.
 

Users who are viewing this thread

Top Bottom