Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a faster way to display image in a report?

Status
Not open for further replies.

OPC

Programmer
Mar 19, 2001
1
JP
Is there anyone who has a better idea on how to code displaying images faster in a report? The images are stored in a separate folder and only the path of those image files are stored in the database as text. We have been able to display the images but the displaying of images is quite slow. I think it's loading the whole set of pictures files first before it displays in the report.

Any feedbacks or tips will be appreciated.

Currently, the code we have done goes like this:



Option Compare Database
Option Explicit

Dim SQLQuery As String
Dim varPhotoPath As String

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim varFilePath As String

varFilePath = varPhotoPath & Me.PHOTO_PATH

If Len(Dir(varFilePath)) Then
Report_PHOTO_OFFER.ImagePho.Picture = varFilePath
Else: Report_PHOTO_OFFER.ImagePho.Picture = varPhotoPath & "blank.jpg"
End If
End Sub

Private Sub Report_Open(Cancel As Integer)
Dim dynX As Recordset

SQLQuery = "select photo_path from photo_path"
Set dynX = CurrentDb.OpenRecordset(SQLQuery, dbOpenDynaset)

If dynX.RecordCount > 0 Then
varPhotoPath = dynX!PHOTO_PATH
Else: varPhotoPath = ""
End If

dynX.Close
Set dynX = Nothing
End Sub



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top