firela112
Goto Top

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.

Content-Key: 309473

Url: https://administrator.de/contentid/309473

Printed on: April 25, 2024 at 09:04 o'clock

Mitglied: 129813
129813 Jul 11, 2016 updated at 10:01:14 (UTC)
Goto Top
Hi
"D:\" & Me.Wache.Value & "-" & Format(Me.WachBeginnDatum.Value,"mm\-dd\-yyyy") & "-" & Format(Me.WachBeginnUhrzeit.Value, "hh\-nn") & ".pdf"  
https://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