Law Tracks - frmContacts - Photo - Edit

J

JK

I'm using the photo function from the Law Tracks example db. Access 2003.
When I try to insert an image into the contacts form, I get an error that
says "You have no program registered on your machine to edit pictures." I'm
running windows xp so I have the standard image editing software. Anyone know
how to correct this? I need the ability to insert images.

This is the code that is supposed to insert an image into the OLE control.

Private Sub cmdNewDraw_Click()
' User wants to insert a photo with code automation
' Set an error trap
On Error GoTo Err_NewDraw
' Look for one of two picture classes (see Form Load code)
If IsNothing(gstrBMPClass) Then ' Prefer Bitmap first
If IsNothing(gstrJPGClass) Then ' Then JPG
' Found nothing registered to edit Bitmap or JPeg - tell them
and exit
MsgBox "You have no program registered on your machine to edit
pictures.", vbCritical, _
gstrAppTitle
Exit Sub
Else
' Found a bitmap class - try it
Me.Photo.Class = gstrJPGClass ' Set Bitmap class name
End If
Else
' Found a Jpeg class - try it
Me.Photo.Class = gstrBMPClass ' Set Jpeg class name
End If
' Set the Action property of the bound OLE frame to create a new object
Me.Photo.Action = acOLECreateEmbed ' Create new embedded object.
' Put the focus on the photo
Me.Photo.SetFocus
' Now, set Action to open the editing program
Me.Photo.Action = acOLEActivate ' Activate the picutre program

Exit_NewDraw:
Exit Sub

Err_NewDraw:
' We get here if setting Action caused an error - inform the user
MsgBox "There was a problem starting the program on your machine that is
registered to edit pictures." & _
" You can try to edit the picture by right-clicking the Photo box
and choosing Insert Object from the shortcut menu.", _
vbOKOnly + vbInformation, gstrAppTitle
' .. and bail
Resume Exit_NewDraw

End Sub
 
J

JK

Thank you, that helped. Although, now I'm getting an error that says "There
was a problem starting the program on your machine that is registered to edit
pictures. You can try to edit the picture by right-clicking the image box and
choosing Insert Object from the shortcut menu."

Any idea why this is happening?
Thx again for your help....

Jason
 
J

JK

I tried changing the default program for .gif and .jpg to be Paint.Net; a
free image editing program. This did not solve my problem.

Does anyone know of a better way to manage images in a database? Although
this concept seems ideal, I've never been able to get it to work correctly.

Any advice would be appreciated.

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top