Load image crashes

S

SteveWalker

Hi,

I've got a form displaying data from tables, which also displays a linked
image in an image control. When I change record on the form, I use VBA to
reload the image to match the new record. Images are stored as jpeg files in
a folder, and are linked to using the info in the record to get a filename.
This works fine, except when records are moved through too quickly, when it
causes Access to crash (AppName: msaccess.exe, ModName: jpegim32.flt). It
seems like this is caused by trying to load an image while the previous image
is still loading (the loading dialog for the previous image is still visible
when it crashes). Below is the code used for loading the image; I was
wondering if anyone had met this before, or knew of a workaround for it (a
way to pause code until the image has loaded maybe?).

Also, while I'm on the subject, a way to not display that "Loading image..."
pop-up would be great - SetWarnings = false and Echo = False don't work.

Thanks,
Steve Walker

Code:

Private Sub Load_Image()
DoCmd.SetWarnings False
Dim fs As Variant
Set fs = CreateObject("Scripting.FileSystemObject")
'Load picture
If fs.FileExists(CurrentProject.Path & "\StudentImages\" &
CurrentAdmissionNumber & ".jpg") Then
Image.Picture = CurrentProject.Path & "\StudentImages\" &
CurrentAdmissionNumber & ".jpg"
Image.Visible = True
Else
Image.Visible = False
End If
DoCmd.SetWarnings True

End Sub
 
S

Stephen Lebans

Hi Allen, the two issues are one and the same. If you use the Registry mod
and disable the "Loading Image" dialog then the GPF bug disappears. A note
to the OP, the Reg Key value must be "No" not "no".

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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