One of the fields in my database stores a path of an image that I want to display on my form. I used the following code in the "On Current" event of my form to achieve this effect:
it works great with the exception that the image doesn't update when the path is changed. If I update the path, I have to navigate to the next record and then back again in order to see the new image. I've tried a couple of things to try to requery the image after the text control is updated, but so far none have worked. This is my most recent attempt on the after update event of my text box:
Does anyone know how I can refresh the image after the text box control is updated?
Code:
Private Sub Form_Current()
If IsNull(Me.text1) Then
Me.ImgPic.Picture = "C:\Users\bharr\Desktop\CupCake.jpg"
Else
Me.ImgPic.Picture = Me.text1
End If
End Sub
it works great with the exception that the image doesn't update when the path is changed. If I update the path, I have to navigate to the next record and then back again in order to see the new image. I've tried a couple of things to try to requery the image after the text control is updated, but so far none have worked. This is my most recent attempt on the after update event of my text box:
Code:
Private Sub text1_AfterUpdate()
Me!ImgPic.Requery
End Sub
Does anyone know how I can refresh the image after the text box control is updated?