photo display in a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the following code in the report.detail.format method

If Len(Me![PhotoPath]) <> 0 Then
If Len(Dir(PhotoPath)) = 0 Then
Me![Photofield].Picture = ""
Else
Me![Photofield].Picture = Me![PhotoPath]
End If
Else
Me![Photofield].Picture = ""
End If

When a the PhotoPath field is blank (because the photo does not exist), the
photo from the previous record is printed. How can I correct this problem?

Thanks
 
I am using the following code in the report.detail.format method

If Len(Me![PhotoPath]) <> 0 Then
If Len(Dir(PhotoPath)) = 0 Then
Me![Photofield].Picture = ""
Else
Me![Photofield].Picture = Me![PhotoPath]
End If
Else
Me![Photofield].Picture = ""
End If

When a the PhotoPath field is blank (because the photo does not exist), the
photo from the previous record is printed. How can I correct this problem?

Thanks

Are you using an Image control for this?
One way...
If Len(Me![PhotoPath]) <> 0 Then
If Len(Dir(PhotoPath)) = 0 Then
Me![Photofield].Visible= False
Else
Me![Photofield].Visible= True
Me![Photofield].Picture = Me![PhotoPath]
End If
Else
Me![Photofield].Picture = False
End If

Second way...

If Len(Me![PhotoPath]) <> 0 Then
If Len(Dir(PhotoPath)) = 0 Then
Me![Photofield].Picture = "(none)"
Else
Me![Photofield].Picture = Me![PhotoPath]
End If
Else
Me![Photofield].Picture = "(none)"
End If

I would go with the Visible/Not Visible method.
 
Back
Top