Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

une liste déroulante dans access pour choisir un dossier

2 réponses
Avatar
jfr
Bonjour,
comment créer une liste déroulante dans access pour choisir un dossier?
merci

2 réponses

Avatar
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


Avatar
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...

http://www.3stone.be/access/articles.php?lng=fr&pg6" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.3stone.be/access/articles.php?lng=fr&pg6

--
A+
Pierre (3stone) Access MVP
Perso: http://www.3stone.be/
MPFA: http://www.mpfa.info/ (infos générales)