Open file dialog

Résolu
aztcaLISS Messages postés 91 Date d'inscription samedi 3 mai 2003 Statut Membre Dernière intervention 25 avril 2008 - 2 août 2006 à 21:05
jamil1976 Messages postés 4 Date d'inscription jeudi 31 août 2006 Statut Membre Dernière intervention 30 juin 2008 - 30 juin 2008 à 09:17
Salut,

Je voudrais savoir comment faire ouvrir une boite de dialogue d'ouveture de fichier avec Access 2000.

Merci

azt
A voir également:

8 réponses

aztcaLISS Messages postés 91 Date d'inscription samedi 3 mai 2003 Statut Membre Dernière intervention 25 avril 2008
2 août 2006 à 21:59
Salut,

J'ai trouvé un example sur ce site:
http://www.databasedev.co.uk/common_dialog.html

azt
3
Molenn Messages postés 797 Date d'inscription mardi 7 juin 2005 Statut Membre Dernière intervention 23 février 2011 7
2 août 2006 à 21:59
Une copie d'un bout de code que j'ai mis dans un autre post récemment. C'est dans PowerPoint, mais ça doit aussi fonctionner dans ACCESS (puisque lorsque je l'ai pondu pour PowerPoint, j'avais repris un truc que j'avais fait dans ACCES, ça devrait coller :p) :

Private Sub CommandButton1_Click()

    Dim OuvrirFichier As FileDialog
    Dim FichierSélectionné As Variant
    
    Set OuvrirFichier = Application.FileDialog( _
        Type:=msoFileDialogOpen)
        
    With OuvrirFichier
        .AllowMultiSelect = True
        .Show
        For Each FichierSélectionné In .SelectedItems
            MsgBox "Chemin du fichier sélectionné : " & FichierSélectionné
        Next
    End With
    
    Set OuvrirFichier = Nothing
    
End Sub

Molenn
0
aztcaLISS Messages postés 91 Date d'inscription samedi 3 mai 2003 Statut Membre Dernière intervention 25 avril 2008
2 août 2006 à 22:01
Merci Molenn


Je vais essayer.

azt
0
sifflet_ Messages postés 70 Date d'inscription mardi 25 juillet 2006 Statut Membre Dernière intervention 2 mai 2007
3 août 2006 à 07:33
Moi, j'ai dû faire ça pour mon projet, mais il y a pas mal de cases à
cocher dans les références de Visual-Basic (tools->references...) .


Entre autres, il faut importer la bibliothèque "Comdlg32.ocx" dans
C:\WINNT\SYSTEM32 qui correspond au "Microsoft Common Dialog Control
6.0 (SP3)". Si t'arrives pas, je t'énumèe la liste de ce qui est coché
chez moi. A+


Sifflet
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
aztcaLISS Messages postés 91 Date d'inscription samedi 3 mai 2003 Statut Membre Dernière intervention 25 avril 2008
3 août 2006 à 18:38
En fait j'ai pris l'example trouvé sur: http://www.databasedev.co.uk/common_dialog.html

Merci quand meme.

azt
0
jamil1976 Messages postés 4 Date d'inscription jeudi 31 août 2006 Statut Membre Dernière intervention 30 juin 2008
8 oct. 2007 à 11:39
de Jamil BETTAIEB: 


------------------------------


Private Sub CommandButton1_Click()
    'Declare a variable as a FileDialog object.
    Dim fd As FileDialog


    'Create a FileDialog object as a File Picker dialog.
    Set fd = Application.FileDialog(msoFileDialogFilePicker)


    'Declare a variable to contain the path
    Dim vrtSelectedItem As Variant


    'Use a With...End With block to reference the FileDialog object.
    With fd


        'Add a filter that includes GIF and JPEG images and make it the first item in the list.
        .Filters.Add "Images", "*.gif; *.jpg; *.jpeg", 1
      
        'If the user presses the action button...
        If .Show = -1 Then


            'Step through each string in the FileDialogSelectedItems collection.
            For Each vrtSelectedItem In .SelectedItems


                'vrtSelectedItem is a String that contains the path of each selected item.
                'You can use any file I/O functions that you want to work with this path.
                'This example simply displays the path in a message box.
                MsgBox "Selected item's path: " & vrtSelectedItem


            Next vrtSelectedItem
        'If the user presses Cancel...
        Else
        End If
    End With


    'Set the object variable to Nothing.
    Set fd = Nothing




End Sub
0
HansPrestat Messages postés 61 Date d'inscription vendredi 19 janvier 2007 Statut Membre Dernière intervention 29 juin 2008
28 mai 2008 à 10:31
Sous VBA j'ai essayé mais ça ne marche pas.

Zozo le clown
0
jamil1976 Messages postés 4 Date d'inscription jeudi 31 août 2006 Statut Membre Dernière intervention 30 juin 2008
30 juin 2008 à 09:17
Non ça c'est avec VB.Net,
avec VBA il faut faire tes modifs
a+
0
Rejoignez-nous