Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Private Function SetPictures(Pic As Integer) As String
 
    Dim fDialog As Office.FileDialog
 
    Dim i       As Long
    Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
    With fDialog
        .Filters.Clear
        .Filters.Add "Photos", "*.jpg; *.jpeg; *.bmp; *.tif", 1
        .AllowMultiSelect = False
 
        .Title = "Choisir images"
        If SearchPath = "" Then
            .InitialFileName = "\\10.0.0.47\photos\" & Me.REF_DOSSIER_B
 
        Else
            .InitialFileName = SearchPath
        End If
        .InitialView = msoFileDialogViewDetails
        .ButtonName = "Enregistrer"
        .Show
        SearchPath = .InitialFileName
        If .SelectedItems.Count > 0 Then
            For i = 1 To .SelectedItems.Count
               Me("LINK_TO_PIC" & Pic) = .SelectedItems(i)
            Next i
        Else
            MsgBox "Erreur"
        End If
    End With
    DoCmd.RunMacro "MKR_UPDATE"
End Function
Bonjour,
Ce code mer permet d'enregistrer le chemin complet d'une image.
Par contre à l'ouverture , Access n'ouvre pas le bon dossier comme indiqué dans :" .InitialFileName = "\\10.0.0.47\photos\" & Me.REF_DOSSIER_B"
mais il ouvre un dossier par défaut .
Peut-être quelqu'un peut m'aider à fixer ce problème ?
Merci d'avance et bonne journée
Claude