Fonction setImagePath / recupérer des photos et les inclure dans un état
Bonjour,
J'utilise la fonction c-dessous sur ms access pour récupérer des photos d'un dossier externe ("\GrandePhotos\) et les inclure dans un état (EtatProformaAll_in) en fonction du nom d'un champ (LienImage.Value). J'aimerais que le champ LienImage renvoie vers toutes les occurences de photos existantes pour une catégorie. Par exemple pour le produit1, il y a 4 photos. produit1.jpg, produit1-2.jpg, produit1-3.jpg et produit1-4.jpg. Par conséquent j'aimerais que l'état imprime 4 pages. une pour chaque occurence de photo renvoyant à la même référence. Merci par avance de me dire c'est clair et surtout si techniquement c'est possible.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Function setImagePath()
Dim strImagePath As String
Dim strMDBPath As String
Dim intSlashLoc As String
On Error GoTo PictureNotAvailable
'Obtain the full path of the current database or Access Project
strMDBPath = CurrentProject.Path & "\GrandePhotos\"
'Find the location of the last backslash
intSlashLoc = InStrRev(strMDBPath, "\", Len(strMDBPath))
'Trim off the database name, leaving the path and append the name of the image file
strImagePath = Left(strMDBPath, intSlashLoc) & _
Report_EtatProformaAll_in_Terms.LienImage.Value
'Set ImageFrame to the path of the image file
Report_EtatProformaAll_in_Terms.Image.Picture = strImagePath
Exit Function |