Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
karamel
bonjour
voici ce que j'utilise pour un dossier, pas de pb, cela fonctionne parfaitement
a+
======================================= Ce code permet d'ouvrir une boîte de dialogue afin de pouvoir sélectionner un répertoire. origine : http://access.jessy.free.fr/
Vous devez copier tout le code qui suit dans un module que vous pouvez appeler "modApiGetDirectory". Ensuite vous n'avez plus qu'à appeler la fonction "GetDirectory()".
L'argument "msg" représente le titre de la boîte de dialogue qui va s'ouvrir.
'***************************Debut du code***************************
Public Declare Function SHGetPathFromIDList Lib "shell32.dll" _ Alias "SHGetPathFromIDListA" (ByVal pidl As Long, _ ByVal pszPath As String) As Long
Public Declare Function SHBrowseForFolder Lib "shell32.dll" _ Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Public Type BROWSEINFO hOwner As Long pidlRoot As Long pszDisplayName As String lpszTitle As String ulFlags As Long lpfn As Long lParam As Long iImage As Long End Type
Function GetDirectory(Optional Msg) As String
Dim bInfo As BROWSEINFO Dim path As String Dim R As Long, X As Long, Pos As Integer
bInfo.pidlRoot = 0
If IsMissing(Msg) Then bInfo.lpszTitle = "Select a folder." Else bInfo.lpszTitle = Msg End If
bInfo.ulFlags = &H1
X = SHBrowseForFolder(bInfo)
path = Space$(512) R = SHGetPathFromIDList(ByVal X, ByVal path)
If R Then Pos = InStr(path, Chr$(0)) GetDirectory = Left(path, Pos - 1) Else GetDirectory = "" End If
End Function
'***************************Fin du code*************************** ==========================================================
"jfr" a écrit dans le message de news:
Bonjour, comment créer une liste déroulante dans access pour choisir un dossier? merci
bonjour
voici ce que j'utilise pour un dossier, pas de pb, cela fonctionne
parfaitement
a+
======================================= Ce code permet d'ouvrir une boîte de dialogue afin de pouvoir sélectionner
un répertoire.
origine : http://access.jessy.free.fr/
Vous devez copier tout le code qui suit dans un module que vous pouvez
appeler "modApiGetDirectory".
Ensuite vous n'avez plus qu'à appeler la fonction "GetDirectory()".
L'argument "msg" représente le titre de la boîte de dialogue qui va
s'ouvrir.
'***************************Debut du code***************************
Public Declare Function SHGetPathFromIDList Lib "shell32.dll" _
Alias "SHGetPathFromIDListA" (ByVal pidl As Long, _
ByVal pszPath As String) As Long
Public Declare Function SHBrowseForFolder Lib "shell32.dll" _
Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Public Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Function GetDirectory(Optional Msg) As String
Dim bInfo As BROWSEINFO
Dim path As String
Dim R As Long, X As Long, Pos As Integer
bInfo.pidlRoot = 0
If IsMissing(Msg) Then
bInfo.lpszTitle = "Select a folder."
Else
bInfo.lpszTitle = Msg
End If
bInfo.ulFlags = &H1
X = SHBrowseForFolder(bInfo)
path = Space$(512)
R = SHGetPathFromIDList(ByVal X, ByVal path)
If R Then
Pos = InStr(path, Chr$(0))
GetDirectory = Left(path, Pos - 1)
Else
GetDirectory = ""
End If
End Function
'***************************Fin du code***************************
==========================================================
"jfr" <richard8.jean-francois@wanadoo.fr> a écrit dans le message de news:
uL1DIH9BKHA.3368@TK2MSFTNGP02.phx.gbl...
Bonjour,
comment créer une liste déroulante dans access pour choisir un dossier?
merci
voici ce que j'utilise pour un dossier, pas de pb, cela fonctionne parfaitement
a+
======================================= Ce code permet d'ouvrir une boîte de dialogue afin de pouvoir sélectionner un répertoire. origine : http://access.jessy.free.fr/
Vous devez copier tout le code qui suit dans un module que vous pouvez appeler "modApiGetDirectory". Ensuite vous n'avez plus qu'à appeler la fonction "GetDirectory()".
L'argument "msg" représente le titre de la boîte de dialogue qui va s'ouvrir.
'***************************Debut du code***************************
Public Declare Function SHGetPathFromIDList Lib "shell32.dll" _ Alias "SHGetPathFromIDListA" (ByVal pidl As Long, _ ByVal pszPath As String) As Long
Public Declare Function SHBrowseForFolder Lib "shell32.dll" _ Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Public Type BROWSEINFO hOwner As Long pidlRoot As Long pszDisplayName As String lpszTitle As String ulFlags As Long lpfn As Long lParam As Long iImage As Long End Type
Function GetDirectory(Optional Msg) As String
Dim bInfo As BROWSEINFO Dim path As String Dim R As Long, X As Long, Pos As Integer
bInfo.pidlRoot = 0
If IsMissing(Msg) Then bInfo.lpszTitle = "Select a folder." Else bInfo.lpszTitle = Msg End If
bInfo.ulFlags = &H1
X = SHBrowseForFolder(bInfo)
path = Space$(512) R = SHGetPathFromIDList(ByVal X, ByVal path)
If R Then Pos = InStr(path, Chr$(0)) GetDirectory = Left(path, Pos - 1) Else GetDirectory = "" End If
End Function
'***************************Fin du code*************************** ==========================================================
"jfr" a écrit dans le message de news:
Bonjour, comment créer une liste déroulante dans access pour choisir un dossier? merci
3stone
Salut,
jfr wrote:
Bonjour, comment créer une liste déroulante dans access pour choisir un dossier? merci
Tu appelles cette fonction comme source d'une liste de valeurs...