conflict when loading external images into form

  • Thread starter Thread starter Brendan
  • Start date Start date
B

Brendan

Hi
My db used to work fine when the images were imbedded. I pulled them out as
the file was growing too large.
Now,
I have a db form which displays images associated with the part no.
The images are stored external to the db as .jpg files.
When the form opens, the following executes fine.


Private Sub Form_Current()
Me!PetID.SetFocus
Me!Pix.Picture = "C:\P\" & Me!PetID.Text & ".jpg"


.... and the correct pet picture displays.


When I rapidly change the records, I will get the Message Box which says
"importing // Cancel" to hang up
in the middle of the screen. It won't go away without a reboot. I get a
Visual Basic error msg

"Method 'Picture' of object '_Image' failed"

I suspect the images are loading asynchronously and don't keep up with the
request to change them.

Is this a possibility? If so, how can I force a wait, so the image is
loaded before the request to change records is processed?

If there are other possible causes, I'd be very interested.

Thanks.
Brendan.
 
Now, I have a db form which displays
images associated with the part no. The
images are stored external to the db as
.jpg files.. . .
When I rapidly change the records, I
will get the Message Box which says
"importing // Cancel" to hang up
in the middle of the screen. It won't go
away without a reboot. . . .

What kind of controls are you using?

Three approaches to handling images in Access are illustrated in the sample
databases you can freely download from http://accdevel.tripod.com. Perhaps
there'll be something there that will be of help -- oh, yes, the download
includes an article discussing considerations in which approach may be
appropriate under different circumstances.

Larry Linson
Microsoft Access MVP
 
Thanks Larry, I reviewed the databases.
I'm doing it very similar to the filename-storage version with external
..jpgs as in the example.
It works fine, EXCEPT for the fleeting "importing..." message.
If the user clicks while that message is active, the message freezes, in the
middle of the screen.
I've tried turning the Update OFF in the Registry, as in another message
here, but No Joy, it didn't stop it.
I'm still anxious for a solution. Getting complaints of having to reboot
just to clear the screen.
Thanks for your suggestions though.
Brendan.
 
Here are 2 common suggestions for dealing with this:

Disable/Hide the navigation buttons until the control has finished decoding.
(though this may not stop the user navigating by a keypress or mousewheel etc).

Don't show the image on the main form (or on the initial display of the form). Instead have the user open
another form, or require that he clicks a tab or button etc to display the image.


Of course, you could also use a different image control/component which doesn't crash when decoding.
Stephens Lebans' Intel jpeg Library solution may be what you need (see www.lebans.com), or our DBPix image
control, which supports asynchronous decoding (without crashing!).
 
Thanks for the suggestions.
I was able to get the "loading" message to be invisible by changing the
Registry for:
HkeyCurrentUser/ SW/ Microsoft/ Shared Tools/ Graphics Filters/ Import /
JPEG / Options /ShowProgress Dialog
To: NO
Seems to work. I'll keep your other suggestions in mind.
Brendan


exponent said:
Here are 2 common suggestions for dealing with this:

Disable/Hide the navigation buttons until the control has finished decoding.
(though this may not stop the user navigating by a keypress or mousewheel etc).

Don't show the image on the main form (or on the initial display of the
form). Instead have the user open
another form, or require that he clicks a tab or button etc to display the image.


Of course, you could also use a different image control/component which doesn't crash when decoding.
Stephens Lebans' Intel jpeg Library solution may be what you need (see
www.lebans.com), or our DBPix image
 
Back
Top