Refresh image on userform

G

Guest

I have created a userform to manage a simple database. On the userform is an
image control which shows a (small) picture from the current record. As I
scroll through the database, the image changes happily. So far so good.
I have now added a click event to the image which loads the current record
picture into a second image control which is contained on a large, but
currently invisible, frame. I then make the frame visible, which gives the
illusion of showing a larger version of the original picture. This larger
image has a click event which simply sets the frame's visible property to
false, hiding the image and returning the user to the original form. Again,
all works well.
Now for the problem... the first image control with the small picture (on
line 2 above!) no longer updates as I continue to scroll through the data.
If I click the image again, the correct 'blow-up' appears, but the small
image does not refresh.
I tried an alternative approach using a second user form to show the
enlarged pcture but still the same problem.
Can anyone suggest a remedy (aside from using Access!!)?
Thanks
 
H

Harald Staff

Hi Graham

Without the possibility to test your setup, this is the general cure for
things like that:

DoEvents
Me.Repaint
DoEvents

HTH. Best wishes Harald
 
G

Guest

Your suggestion worked. I'd tried the DoEvents but on its own that wasn't
enough. The Repaint was not obvious but did the trick. Many thanks.
 

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