Hoi mede forummers,
Ik wil foto's in een rapport plaatsen.
Onderstaande code werkt.
In een database wil ik nu een standaard pad invullen waardoor de foto locatie niet afhankelijk wordt van de VBA-code.
Het volgende heb ik geprobeerd maar werkt niet.
of
Waar kan ik mijn beperkte kennis mee uitbreiden?
Vriendelijke groet
Eric
Ik wil foto's in een rapport plaatsen.
Onderstaande code werkt.
Code:
Function setImagePath()
Dim strImagePath As String 'Locatie van de foto's
On Error GoTo PictureNotAvailable
strImagePath = "D:\Foto's K1\" + Vis_LijstFotoA 'Pad en bestandsnaam
Me.ImageFrame.Picture = strImagePath
Exit Function
PictureNotAvailable:
Me.ImageFrame.Height = 0
End Function
In een database wil ik nu een standaard pad invullen waardoor de foto locatie niet afhankelijk wordt van de VBA-code.
Het volgende heb ik geprobeerd maar werkt niet.
Code:
Function setImagePath()
Dim strImagePath As String 'Locatie van de foto's
On Error GoTo PictureNotAvailable
strImagePath = Vis_LijstPath + Vis_LijstFotoA ' Vis_LijstPath is de fotolocatie = D:\Foto's K1\
Me.ImageFrame.Picture = strImagePath
Exit Function
PictureNotAvailable:
Me.ImageFrame.Height = 0
End Function
Code:
Function setImagePath()
Dim strImagePath As String 'Locatie van de foto's
Dim strImageName As String 'Naam van het fotobestand incl. extensie
On Error GoTo PictureNotAvailable
strImagePath = Vis_LijstPath
strImageName = Vis_LijstFotoA
Me.ImageFrame.Picture = strImagePath + strImageName
Exit Function
PictureNotAvailable:
Me.ImageFrame.Height = 0
End Function
Waar kan ik mijn beperkte kennis mee uitbreiden?
Vriendelijke groet
Eric