User Tools

Site Tools


it_inventar_datenbank

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
it_inventar_datenbank [2025/12/17 15:17] – kalaschnikowit_inventar_datenbank [2026/03/04 09:13] (current) – kalaschnikow
Line 1: Line 1:
 +====== IT Inventar Datenbank ======
  
 +[[DJHN]]
 +
 +===== ToDo =====
 +
 +  * For_InventarArbeitsmittel
 +    * **-** make fields wider 
 +
 +===== Misc =====
 +
 +
 +Bericht "AusgabeArbeitsmittel"
 +
 +Um Inventarnummer aus dem Formular zu übergeben:
 +
 +<code sql>
 +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));
 +</code>
 +
 +
 +Checken, ob ein Ordner existiert:
 +
 +<code >
 +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
 +
 +</code>
 +
 +
 +Ausgabe von einem Bericht in eine Datei:
 +
 +<code vba>
 +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
 +</code>