I recently changed database from OLE pictures to new fields reflecting picture path/filename. One report is not working right. It says it can't find the field. I've used Link Manager to point all tables to the right backend mdb file. Other reports on this form are working ok.
While I could upload the whole thing to a coder if necessary, I'd prefer to work with a coder telling me what to change. The report gets an error "can't find the field PicturePath". When I click on Debug, it gives me this code from the report:
=> will put this info into the "details" field, as it does not fit here
I don't know VBA well enough to see what's wrong, but I suspect it's something pretty simple with how it's calling the PicturePath field.
This is the highlited line in the debugger:
If IsNull([login to view URL]) Then ' if there no picture path written
The Record Source for this report is the Employee Summary Query, which in turn gets the PicturePath field from the Employee List table.
## Deliverables
This is failing code that the debugger points to:
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
[login to view URL] = False ' initially make both the images invisible
Dim mydestdir As String ' This will hold the back end directory
mydestdir = [login to view URL]("Employee list").Connect
mydestdir = Replace(mydestdir, ";Database=", "", 1, -1, vbTextCompare)
mydestdir = Left(mydestdir, Len(mydestdir) - Len(Dir(mydestdir)))
' By this the back end directory is obtained
Picture:
If IsNull([login to view URL]) Then ' if there no picture path written
ElseIf Dir(mydestdir & [login to view URL]) = "" Then 'IF the picture is not found in the path specified
ElseIf InStr(1, [login to view URL], "Noimage", vbTextCompare) > 0 Then
' if the picture is [login to view URL] which we don't want to show in the report
Else
[login to view URL] = True ' If the picture is found make the image visible
[login to view URL] = mydestdir & [login to view URL] 'show the picture in the box
End If
End Sub
***********************************
and this is the failing line:
If IsNull([login to view URL]) Then ' if there no picture path written