Bonjour a tous les developpezcomiens,

C'est avec succes que j'ai pu faire apparaitre filepicker montrant les images des fichiers selectionnes en utilisant "msoFileDialogViewPreview"
. a Helas pour ses conseils

J'avais deja auparavant (avant d'utiliser "msoFileDialogViewPreview") un petit soucis concernant la selection en multi-selection ...

Le 1er fichier selectionne devient le dernier enregistrement dans la base et vis versa le dernier devient le 1er

Lorsque je selectionne le dernier fichier en premier et je termine la selection par le 1er fichier tout s'enregistre dans l'ordre 1,2,...8

Je sais bien que les 1er seront les derniers mais tout de meme...

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
33
34
35
36
37
38
39
40
41
42
 
 
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim PathSelectedItem As Variant
Dim ActualShowroomStyleSystem As Long
 
ActualShowroomStyleSystem = Forms![StyleShowroom]![ShowroomStyleSystem]
 
    With fd
        .InitialView = msoFileDialogViewPreview
        .Filters.Add "IMAGES", "*.JPG"
        .Title = "LES IMAGES"
        .AllowMultiSelect = True
        .InitialFileName = "C:\Documents and Settings\Lang\My documents\Taffles South\Sys\"
        If .Show = -1 Then
            For Each PathSelectedItem In .SelectedItems
                MsgBox "Selected file's path: " & PathSelectedItem
                '---------------------------------------------------------------- Update PictureBase
                DoCmd.OpenForm "NewPictureShowroom", , , "ShowroomStyleSystem = " & ActualShowroomStyleSystem
                If Forms![NewPictureShowroom]![PictureAddress] = "C:\Documents And Settings\Lang\My documents\Taffles South\Sys\Nothing.jpg" Then
                    Forms![NewPictureShowroom]![PictureAddress] = PathSelectedItem
                    Forms![NewPictureShowroom]![Nothing].SetFocus
                    DoCmd.Close acForm, "NewPictureShowroom", acSaveNo
                Else
                    Forms![NewPictureShowroom]![ShowroomStyleSystem].SetFocus
                    DoCmd.GoToRecord , , acNewRec
                    Forms![NewPictureShowroom]![ShowroomStyleSystem] = ActualShowroomStyleSystem
                    Forms![NewPictureShowroom]![ShowroomPictureRank] = DMax("ShowroomPictureRank", "PictureShowroom", "ShowroomStyleSystem = " & ActualShowroomStyleSystem) + 1
                    Forms![NewPictureShowroom]![ShowroomPictureRef] = ActualShowroomStyleSystem & "/" & Forms![NewPictureShowroom]![ShowroomPictureRank]
                    Forms![NewPictureShowroom]![PictureAddress] = PathSelectedItem
                    Forms![NewPictureShowroom]![Nothing].SetFocus
                    DoCmd.Close acForm, "NewPictureShowroom", acSaveNo
                End If
            Next PathSelectedItem
        Else
        End If
    End With
 
    Set fd = Nothing
 
    Recalc