JPEG's In Access 2003 Report

Karen831

Registered User.
Local time
Today, 06:33
Joined
Jun 5, 2007
Messages
26
Does anyone know what this error message mean. All JPEG's are the same format/size... I am uploading about 4000 (Using an unbound image link)- Embedded but this one seems to have a problem


"MS OFFICE ACCESS DOESN'T SUPPORT THE FORMAT OF THE FILE I://DDC/INSTITV/ATTACHED/0531164.JPEG, OR FILE IS TOO LARGE.
TRY CONVERTING THE FILE TO BMP OR GIF FORMAT"
 
Check the file is readable in other programs. Try resaving it as a new jpg file. (Consider changing the file extension to jpg rather than jpeg).
I'd also try to avoid storing 4000 OLE ojects in a database. See this kb link for an alternative way of displaying images in forms and reports.
 
Thank you. Unfortunetly I am not advanced enough to be able to do it the way you attached. Can you help me further in understanding your link?
 
I can try!
The idea is generally that rather than store the image in the database, you store the path to the image. When the image needs to be displayed (on a form or report), you tell access to display the picture that is in that path.

SO the first thing to do is create a field (in the table which holds the records which will have a picture associated with it) named txtImagePath or some such. The second thing is to create a 'blank' image that will act as a placeholder for when there is no image to show.

Now, on your form, Create an unbound image control imgYourPic with your 'blank' image, and a text field bound to txtImagePath. Now, in the View menu, click 'Code, and paste the following code: (also found in the kb article linked above):
Code:
Function setImagePath()
    Dim strImagePath As String
    On Error Goto PictureNotAvailable 
    strImagePath = Me.txtImagePath
    Me.imgYourPic.Picture = strImagePath
Exit Function
    PictureNotAvailable:
    strImagePath = "C:\Path\To\BlankPicture.BMP"
    Me.imgYourPic.Picture = strImagePath
End Function
Close the Code window, and return to the form in design view. In the properties dialog, go to the Events tab, and put =SetImagePath() in the boxes labelled OnCurrent and AfterUpdate.

To display the image in a report, repeat the above steps, but place =SetImagePath() in the OnFormat event of the Detail of the report.

Hope this helps a bit!
 

Users who are viewing this thread

Back
Top Bottom