views:

34

answers:

1

I have a report in MS Access with 4 image controls. In the format event of the detail section I have code that sets the picture property based on the values of fields in DAO.recordset. Below is an example of my code.

For i = 0 To 3
    If Not rs.EOF Then
        Me.Controls("img" & i).Picture = blobGet(rs!phBlobId)
        rs.MoveNext
    Else
        Me.Controls("img" & i).Picture = ""
    End If
Next i

Basically the rs!phBlobId field is a file name. The blobGet function returns the full path to the picture which then sets the picture property of the correct control in the detail section of my report.

I'm not sure all of the causes but under certain circumstances the pictures will not show up in the controls. I have a similar set up on a form and have no trouble at all there, I only have the issue when on a report.

One thing that seems to possibly be the cause is the size of the picture. If I insert a large picture (say over 5 megs) it sometimes won't show up. With different combination of pictures different ones show up.

I am open to both solutions to my problem as described above or to alternative ideas how to show these pictures on the report. One absolute requirement is that the pictures be set with VBA as the exact arrangement of the pictures varies based on an unrelated variable.