Hello to all,
I am using an image control on a report to show a picture through a hyperlink based off of 2 fields. I can get the picture to show with now problem. But if there is no file name in Me!Photo, the report uses the picture from the previous record.
I am trying to use the following code on the OnFormat Event of the report:
Image = Image Control
Me!Photo = File name
DFirst("Location", "tblLocation") = File path location
Please tell me what's wrong with this code...because its not working!!! Thanks
BakerUSMC
I am using an image control on a report to show a picture through a hyperlink based off of 2 fields. I can get the picture to show with now problem. But if there is no file name in Me!Photo, the report uses the picture from the previous record.
I am trying to use the following code on the OnFormat Event of the report:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If (IsNull(Me!Photo)) Then
Me![Image].Properties("Picture") = ""
Else
Dim strFilePath As String
strFilePath = DFirst("Location", "tblLocation") & Me!Photo
If Dir$(strFilePath) <> "" Then
'It exists
Me![Image].Properties("Picture") = DFirst("Location", "tblLocation") & Me!Photo
Else
'It don't.
Me![Image].Properties("Picture") = ""
End If
End If
End Sub
Image = Image Control
Me!Photo = File name
DFirst("Location", "tblLocation") = File path location
Please tell me what's wrong with this code...because its not working!!! Thanks
BakerUSMC