IF !EOF() thisform.text1.value=thisform.text1.value+1 thisform.text2.value=nam local lcImageFile lcImageFile = "images\"+alltrim(str(thisform.text1.value)) +(".jpg")+(".GIF") if file(lcImageFile) ThisForm.Image1.Picture = lcImageFile else MessageBox("The picture doesn't exist - filename: " + lcImageFile) endif SKIP else skip -1 ENDIF>Of course you get an error! You changed Hilmar's lcImagefile variable into lcFilename, and by doing so, you create an error! Do you ever spend more than one second thinking why? And please, please, please try understand how things work, and you will see these things yourself. If you don't even try to find these easy-to-see errors yourself, how can you expect any help?
>>**at command button via click event >>IF !EOF() >> thisform.text1.value=thisform.text1.value+1 >> thisform.text2.value=nam >> local lcImageFile >> lcImageFile = "images\"+alltrim(str(thisform.text1.value)) +(".jpg")+(".GIF") >>if file(lcImageFile) >> ThisForm.Image1.Picture = lcImageFile >> SKIP >>else >> MessageBox("The picture doesn't exist - filename: " + lcFileName) >> skip -1 >>endif >>ENDIF >> >>>>
>>>local lcImageFile >>>lcImageFile = "images\"+alltrim(str(thisform.text1.value))+(".GIF") +(".jpg")&& or and +(".jpg") >>>MessageBox("The filename is: " + lcImageFile) >>>Thisform.Image1.Picture = lcImageFile >>>>>>
>>>if file(lcImageFile) >>> ThisForm.Image1.Picture = lcImageFile >>>else >>> MessageBox("The picture doesn't exist - filename: " + lcFileName) >>>endif >>>