Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Insert jpg image in Object field

1 view
Skip to first unread message

Mike Geoghegan

unread,
Sep 10, 2002, 4:44:41 PM9/10/02
to
How do I insert a jpg format picture into a Bound Object
Frame? I have tried to convert the jpg object to a bmp
format and then insert it into an OLE Object field in a
Table. Instead of identifying the Object as a Bitmap, it
calls it a "Package". When I view the corresponding form,
the picture appears as an icon with it's filename. I have
the Object Frame set to Zoom to fill it out, but it still
appears as an icon. I am trying to make a form that will
show a different photo for each record. Thanks for any
help!

Joe Fallon

unread,
Sep 10, 2002, 7:40:35 PM9/10/02
to
Use an unbound image frame named: ImageFrame
and add a field to your table called ImagePath.

To add the picture to a report just use code like this in the On Format
event of the Detail Section.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me![ImageFrame].Picture = Me![ImagePath]
End Sub

In the OnCurrent event of the form use this code:

Private Sub Form_Current()
On Error GoTo Err_Form_Current

If IsNull(Me![ImagePath]) Then
Me![ImageFrame].Picture = "c:\msaccess.jpg"
Else
Me![ImageFrame].Picture = Me![ImagePath]
End If

Exit_Form_Current:
Exit Sub

Err_Form_Current:
Select Case Err.Number
Case 2220
'ignore the Can't Load Image error
Case Else
MsgBox ("Error # " & Str(Err.Number) & " was generated by " &
Err.Source & Chr(13) & Err.Description)
Resume Exit_Form_Current
End Select

End Sub

The image takes a second or two to load. A dialog is put on screen too.
This process can get very annoying after a while because it happens every
time the user navigates to another record.

From Tony Toews' web site: http://www.granite.ab.ca/access/imagehandling.htm
Getting tired of seeing that Loading Image dialogue flicker? Getting errors
by users who click on things before this is finished displaying? Try
creating/changing the following registry key
HKEY_LOCAL_MACHINE\Software\Microsoft\Shared
Tools\GraphicsFilters\Import\JPEG\Options
ShowProgressDialog to No

I use the Tab control to "hide" the image on a different "page".
I also move the code to the OnGotFocus event of the ImagePath text box
which is on the next page of the Tab control.
This way, the only time the picture loads is when the user clicks the tab to
see it.

--
Joe Fallon
Access MVP

"Mike Geoghegan" <mgeog...@mayinstitute.org> wrote in message
news:10a1601c2590a$e2f139c0$9ee62ecf@tkmsftngxa05...

0 new messages