delay loading of image on form

  • Thread starter Thread starter Jesper F
  • Start date Start date
J

Jesper F

I'm loading on image into an image control with
Me.image1.Picture = "c:\1.jpg"
on the Form_current event

If I scrool through the records Access crashes if I don't let it load the
image before scrolling to the next record.
Is there a way to delay the loading of the image perhaps haf a second?

/ Jesper
 
I'm loading on image into an image control with
Me.image1.Picture = "c:\1.jpg"
on the Form_current event

If I scrool through the records Access crashes if I don't let it load the
image before scrolling to the next record.
Is there a way to delay the loading of the image perhaps haf a second?

You can load the Image in the form's Timer event. Move your image load code to that event, then do this:

Sub Form_current()
Me.TimerInterval = 500 '/in milliseconds, so this is half a second
End Sub

Sub Form_Timer()
'/turn OFF the timer
Me.TimerInterval = 0
<your image load code>
End Sub

So as you scroll, you turn the timer ON in the Current event, then OFF in the Timer event and fire your code.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Sub Form_current()
Me.TimerInterval = 500 '/in milliseconds, so this is half a second
End Sub

Sub Form_Timer()
'/turn OFF the timer
Me.TimerInterval = 0
<your image load code>
End Sub

Off course. Thanks.
 
Back
Top