TheDoubleB
Programmer
I am creating a Employee book. I use the following code to display the linked picture on a form. The filename is stored in the table in field [PicLoc]. The form field name is [Image40]. If it isn't found I use the NoPicAvail.bmp.
Private Sub Form_Current()
Set fs = Application.FileSearch
With fs
.LookIn = "_PATH_"
.FileName = [PicLoc]
If .Execute > 0 Then
Me![Image40].Picture = Me![PicLoc]
Else
Me![Image40].Picture = CStr("C:\NoPicAvail.bmp"
End If
End With
End Sub
Simple enough, however my question is how do I translate this to a report.
The report was using and embedded picture field ([Pic]) in the table with an IIF statement to display the name if there was no picture.
=IIf(IsNull([Pic]),[FirstName] & ' ' & [LastName],'')
How do I accomplish this with a linked field?
Private Sub Form_Current()
Set fs = Application.FileSearch
With fs
.LookIn = "_PATH_"
.FileName = [PicLoc]
If .Execute > 0 Then
Me![Image40].Picture = Me![PicLoc]
Else
Me![Image40].Picture = CStr("C:\NoPicAvail.bmp"
End If
End With
End Sub
Simple enough, however my question is how do I translate this to a report.
The report was using and embedded picture field ([Pic]) in the table with an IIF statement to display the name if there was no picture.
=IIf(IsNull([Pic]),[FirstName] & ' ' & [LastName],'')
How do I accomplish this with a linked field?