1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Function setImagePath2()
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) & _
Form_Frm_Pricing2.LienImage.Value
'Set ImageFrame to the path of the image file
Form_Frm_Pricing2.Image.Picture = strImagePath
Exit Function
PictureNotAvailable:
strImagePath = CurrentProject.Path & "\Vignettes\defaut.jpg"
Form_Frm_Pricing2.Image.Picture = strImagePath
End Function |
Partager