Hi Ray,
The code in the frmEmployees form, in my ImageDemo sample, came from a copy
of Northwind. The "picture not found" response that you see is from code in
this form's Current event procedure. It turns out that this code includes On
Error Resume Next, so it is not going to result in an error number or message
similar to what you are seeing with your database being displayed.
I'd like you to try an experiment using my ImageDemo sample on the Windows
XP machine. First, open the tblEmployees table in normal view, and scroll
horizontally until you see the field named "Photo". For Employee ID 5, Steven
Buchanan, and for Employee ID 8, Laura Callahan, enter valid paths to two
images saved in some folder on your hard drive. For example:
C:\Temp\Picture1.jpg and
C:\Temp\Picture2.jpg
(I'm having you enter paths to valid pictures for these two people, since
the form's recordset is ordered ascending by lastname, and firstname--these
are the first two records that you should see).
Then open the frmEmployees form in design view. Then click on View > Code.
Scroll down to where you should see the Current event procedure for this form:
Private Sub Form_Current()
Add some Debug.Print statements, as indicated below:
Me![ImageFrame].Picture = fName
ShowImageFrame
Me.PaintPalette = Me![ImageFrame].ObjectPalette
Debug.Print "Me.PaintPalette: " & Me.PaintPalette
Debug.Print "[ImageFrame].Picture: " & Me![ImageFrame].Picture
Debug.Print "fName: " & fName
Debug.Print
If (Me![ImageFrame].Picture <> fName) Then
HideImageFrame
errormsg.Caption = "Picture not found"
errormsg.Visible = True
End If
Minimize the code window. Reopen the form in normal mode, and then use the
navigation button to move to record # 2 for Laura Callahan. Then tap <Ctrl>
<G> (the Control and G keys, at the same time) to open the Immediate window.
You should see something like the following:
Me.PaintPalette: `A @ ` ? À à †? ? 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?[ImageFrame].Picture: C:\Temp\Picture1.jpg
fName: C:\Temp\Picture1.jpg
Me.PaintPalette: `A @ ` ? À à †? ? 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
[ImageFrame].Picture: C:\Temp\Picture2.jpg
fName: C:\Temp\Picture2.jpg
The first line for each image will be a bunch of weird characters (I'm not
showing the entire contents of the first line). The point is that *something*
similar should be printed to the Immediate Window for Me.PaintPalette. I'm
thinking that something is interferring with the ObjectPalette property on
your system. Here is some information that I copied from the Access 2003 Help
system, when I selected the word ObjectPalette in the Current event
procedure, and pressed the F1 button to bring up context-sensitive Help:
If the application associated with the OLE object, bitmap, or other graphic
doesn't have an associated palette, the ObjectPalette property is set to an
zero-length string.
The setting of the ObjectPalette property makes the palette of the
application associated with the OLE object, bitmap, or other graphic
contained in a control available to the PaintPalette property of a form or
report.
=====================================
Experiment # 2:
Please navigate to Access MVP Stephen Leban's page here:
http://www.lebans.com/loadjpeggif.htm
Download the file A2KLoadJpegGifGDIPlus.zip and extract the .mdb sample from
it. Open the form named "frmStdPicToPictureData" (do not open the subform
named "JpegGifSubForm"). Are you able to load an image into this form, on the
Windows XP machine?
Experiment # 3:
Try downloading and installing the .dll file found in the "GDI+DLL.zip"
download that Stephan makes available.
Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
Ray said:
Thanks for responding,
Your image demo worked fine on my 2000 computer, but not on the XP. On XP,
it doesn't give the same error, but rather it just says "picture not found."
I looked at the references and couldn't find anything missing or out of date.
As far as I can tell, article 319832 doesn't apply because it doesn't work
at all, even once, but I think perhaps I am in a bit over my head here.