DataMinerHome
Registered User.
- Local time
- Yesterday, 17:31
- Joined
- Jan 4, 2010
- Messages
- 57
I have a report which displays images located outside of Access. This is a fairly large report, with and all the images are jpg's. When I print the report, intermittently, some of the jpg's just don't show up. It's different ones each time. When I view the report on screen, when it gets to a certain page, I get the error message "mydb doesn't support the format of the file "mypic.jpg", or the file is too large. Try converting to bmp or gif."
The report currently has 58 pages, each with a picture. When I view the report on screen, at the 22nd page, I start getting the error message "mydb doesn't support the format of the file "mypic.jpg", or the file is too large. Try converting to bmp or gif."
The images for these are still jpg's and are in fact smaller than some of the jpgs in the preceding pages.
In addition, if I open a smaller subset of the report, these pages open fine.
Code is shown below. Access 2003 on Windows XP.
Any ideas? My best idea right now is to set up the report to print, say, 10 pages at a time, close, reopen and print the next 10 pages, etc.
The report currently has 58 pages, each with a picture. When I view the report on screen, at the 22nd page, I start getting the error message "mydb doesn't support the format of the file "mypic.jpg", or the file is too large. Try converting to bmp or gif."
The images for these are still jpg's and are in fact smaller than some of the jpgs in the preceding pages.
In addition, if I open a smaller subset of the report, these pages open fine.
Code is shown below. Access 2003 on Windows XP.
Any ideas? My best idea right now is to set up the report to print, say, 10 pages at a time, close, reopen and print the next 10 pages, etc.
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
GetPicturesForReport Me.Report
End Sub
Code:
Sub GetPicturesForReport(RPT As Report)
Dim DB As DAO.Database
On Error GoTo ErrHandle
Set DB = CurrentDb
RPT.Controls("Image1").Visible = True
RPT.Controls("image1").Picture = ImagePath & RPT.Controls("StandID").Value & ".jpg"
GoTo CloseAll
ErrHandle:
Select Case Err.Number
Case 2719 '"a problem occurred while accessing the ole object"
MsgBox "can't link to " & RS!PictureAddress
Case 2220 'no picture file
RPT.Controls("image1").Visible = False
Case Else
MsgBox Err.Description
End Select
CloseAll:
Set RS = Nothing
Set DB = Nothing
Set F = Nothing
End Sub