Bericht “AusgabeArbeitsmittel”
Um Inventarnummer aus dem Formular zu übergeben:
SELECT Inventar.Inventarnummer, Inventar.Gerätetyp, Inventar.Hersteller, Inventar.Modell, Inventar.[S/N], Inventar.gekauft, Inventar.Bereich, Inventar.Kostenstelle, Kostenstellen.Bezeichnung, Inventar.Nutzer, Inventar.Standort, Standort.Ort, Inventar.Bereich, Inventar.[Zubehör bei Auslieferung], [Zustand] AS Ausdr1, [weiteres Zubehör] AS Ausdr2 FROM Standort INNER JOIN (Kostenstellen INNER JOIN Inventar ON Kostenstellen.KSt = Inventar.Kostenstelle) ON Standort.Standort = Inventar.Standort WHERE (((Inventar.Inventarnummer)=Forms!For_InventarArbeitsmittel!Inventarnummer));
Checken, ob ein Ordner existiert:
Private Sub Befehl274_Click()
Dim Inventarnummer As String
Dim foldername As String
foldername = "\\djhn.local\fileshare\Interner Dienst\IT\EDV\Bestandsliste\_Inventar Arbeitsmittel\" & Me.Inventarnummer
Dim oFSO As Object
Set oFSO = CreateObject("Scripting.FilesystemObject")
If oFSO.FolderExists(foldername) = True Then
' MsgBox "Folder " & foldername & " exists"
Else
'File doesn't exist
' MsgBox "Folder " & foldername & " doesn't exist. It should be created now."
MkDir foldername
End If
FollowHyperlink foldername
End Sub
Ausgabe von einem Bericht in eine Datei:
Private Sub Befehl275_Click()
Dim strReport As String
Dim strWhere As String
Dim strFileName As String
Dim strFolder As String
Dim intChoice As Integer
Dim strPath As String
strReport = "Ausgabe Token"
'strWhere = "[ClientID]=" & Me.ClientID
strFileName = Format(Date, "yyyy mm ") & "Ausgabe Token " & Me.[Name, Vorname] & ".pdf"
'DoCmd.OpenReport strReport, acViewPreview, , strWhere, acWindowNormal
'Insert the file name in the File Dialog window
Application.FileDialog(msoFileDialogSaveAs).InitialFileName = strFileName
'make the file dialog visible to the user
intChoice = Application.FileDialog(msoFileDialogSaveAs).Show
'determine what choice the user made
If intChoice <> 0 Then
'get the file path selected by the user
strPath = _
Application.FileDialog(msoFileDialogSaveAs).SelectedItems(1)
'displays the result in a message box
'Call MsgBox(strPath, vbInformation, "Save Path")
Else
DoCmd.Close acReport, strReport
Exit Sub
End If
DoCmd.OutputTo acOutputReport, strReport, acFormatPDF, strFileName, False
'DoCmd.OutputTo acOutputReport, "Ausgabe Token", acFormatPDF, "Datei.pdf"
End Sub