Image1.PictureSizeMode = fmPictureSizeModeZoom
Image1.Picture = LoadPicture(TextBox1.Value) ' only BMP, GIF, JPG, WMF, EMF, ICO, CUR, Not PNG
1. Does the file "Pict1.jpg" exist in the folder "C:\Users\Images"? Have you checked?Dear @hungtbatman1 , i want the value in the textbox come from a datalist. See my other post (this one)for example
Therefor i used this code but its not correct.
Me.txtPict.Value = Me.lstPlanningslijst.List(Me.lstPlanningslijst.ListIndex, 33) 'in this row its says C:\Users\Images\Pict1.jpg
Me.Image1.PictureSizeMode = fmPictureSizeModeZoom
Me.Image1.Picture = LoadPicture(txtPict.Value)
dim i as long, text as string
text = txtPict.value
Debug.Print Dir(text)
for i = 1 to len(text)
Debug.Print AscW(mid(text, i, 1))
next
Me.Image1.Picture = LoadPicture(CSTR(Me.txtPict.Value))
Dear @hungtbatman1 and @NdNoviceHlp , after a couple of times to trying solving this problem it was the settings of the cell.
Now i have the next question....
I have the possibility to reset the form, only the picture remain to stay.
Maybe something like:
If there is no value in the textbox then load a picture (blanc)
Private Sub CommandButton1_Click()
If txtPict.Value <> "" Then
Image1.Picture = LoadPicture(txtPict.Value)
Else
Image1.Picture = Nothing ' Image1.Picture = LoadPicture("C:\Users\Images\blanc.jpg")
End If
End Sub