Forum

Forum (https://www.ms-office.gr/forum/)
-   Access - Ερωτήσεις / Απαντήσεις (https://www.ms-office.gr/forum/access-erotiseis-apantiseis/)
-   -   [ Active X Controls ] Πρόβλημα σε εξαγωγή έκθεσης σε PDF "The OutputTo action was canceled" (https://www.ms-office.gr/forum/access-erotiseis-apantiseis/5074-problima-se-eksagogi-ekthesis-se-pdf-outputto-action-canceled.html)

smasak 15-11-18 06:37

Πρόβλημα σε εξαγωγή έκθεσης σε PDF "The OutputTo action was canceled"
 
Καλημέρα, θέλω να εξάγω έκθεση σε pdf και σε ένα button έχω τον κώδικα

"Private Sub PDFcat_Click()
DoCmd.SetWarnings False
If Me.CompoRACE <> "" And Me.CATEGORY <> "" Then
DoCmd.OpenReport "rptResults", acViewPreview, , "[ID_RACE]=" & Me.CompoRACE & "and " & "[CATEGORY]=" & Me.CATEGORY
DoCmd.OutputTo acOutputReport, "rptResults", _
acFormatPDF
Else
MsgBox "Ðáñáêáëþ åðéëÝîôå Áãþíá & Êáôçãïñßá"
DoCmd.SetWarnings True
End If
End Sub"

Μου ανοίγει το browse για αποθήκευση κανονικά και αν επιλέξω σημείο μου το αποθηκεύει. Αν όμως κάνω cancel τότε μου βγάζει το μήνυμα "runtime error 2501 the outputTo action was canceled".

nasos23 16-11-18 07:15

Καλημέρα σε όλους.
Σάκη δοκίμασε αυτό και δες αν σου κάνει.
Κώδικας:

Private Sub PDFcat_Click()
On Error GoTo MyErrorHandler
DoCmd.SetWarnings False
If Me.CompoRACE <> "" And Me.CATEGORY <> "" Then
DoCmd.OpenReport "rptResults", acViewPreview, , "[ID_RACE]=" & Me.CompoRACE & "and " & "[CATEGORY]=" & Me.CATEGORY
DoCmd.OutputTo acOutputReport, "rptResults", _
acFormatPDF
DoCmd.Close acReport, "rptResults"
MyErrorHandler:
If Err.Number = 2501 Then
MsgBox "Ακύρωση αποθήκευσης"
Resume Next
Else
DoCmd.SetWarnings True
End If
End If
End Sub


smasak 16-11-18 12:38

Τέλεια, μπράβο Νάσο.


Η ώρα είναι 21:06.

Ms-Office.gr - ©2000 - 2026, Jelsoft Enterprises Ltd.


Search Engine Optimization by vBSEO 3.3.2