firela112

Access365 Bericht per PDF speichern

Hi habe folgenden Code:
Private Sub Befehl39_Click()
Dim stDocName As String
Dim LinkCriteria As String

stDocName = "Wache"
LinkCriteria = "[WacheID] = " & Me.[WacheID]
DoCmd.OpenReport stDocName, acPreview, , LinkCriteria
DoCmd.OutputTo acOutputReport, "Wache", acFormatPDF, "D:\" & [Wache] & ".pdf", False
DoCmd.Close acReport, stDocName
End Sub

Dabei wird der Aktuelle Datensatz per PDF in Datei "Wache.pdf" gespeichert (soweit klar).
Jedoch möchte ich hinter "Wache", noch das Datum ([WachBeginnDatum]; Format: 99.99.0000;0;_) und die Uhrzeit ([WachBeginnUhrzeit]; Format: 00:00;0;_) das in dem aktuellen Datensatz vorkommt, speichern lassen. Und da komm ich nicht mehr klar. Kann mir jemand helfen?

Sollte dann so aussehen: Wache-12-12-2016-10-30.pdf oder so ähnlich, damit man halt Wache,Datum,Uhrzeit rauslesen kann.
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 309473

Url: https://administrator.de/forum/access365-bericht-per-pdf-speichern-309473.html

Ausgedruckt am: 09.07.2025 um 05:07 Uhr

129813
129813 11.07.2016 aktualisiert um 12:01:14 Uhr
Hi
"D:\" & Me.Wache.Value & "-" & Format(Me.WachBeginnDatum.Value,"mm\-dd\-yyyy") & "-" & Format(Me.WachBeginnUhrzeit.Value, "hh\-nn") & ".pdf"  
msdn.microsoft.com/de-de/library/office/gg251755.aspx

Notes: Depending on how you store your date and time values in the database it could be that you have to use cDate() to convert the values to date time format.

Regards