Hi, i have a program that a user enters a serial number to search, the program then displays all the information about that item. Yesterday i added a function that the program now shows a picture of the item being searched, problem is, if the serial number is not on the system and the picture does not exist it throws up the debug error.
I want to know how do i code this, that if the image file does not exist, the program moves on without it?
If opin Then 'Option for search criteria on form
DataEnvironment1.rsCommand1.MoveFirst
DataEnvironment1.rsCommand1.Find ("[No] ='" & (TxtSearch.Text) & "'")
Image1.Picture = LoadPicture("\\Jupiter\Shared\Labeller\Pictures\" & (TxtSearch.Text) & ".jpg")
'the above line is where the program stops if no image exists...
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
TxtLotR.Text = "PR-"
txtrev.Text = lblrev1.Caption
TxtLotR.SetFocus
Thanks in advance
I want to know how do i code this, that if the image file does not exist, the program moves on without it?
If opin Then 'Option for search criteria on form
DataEnvironment1.rsCommand1.MoveFirst
DataEnvironment1.rsCommand1.Find ("[No] ='" & (TxtSearch.Text) & "'")
Image1.Picture = LoadPicture("\\Jupiter\Shared\Labeller\Pictures\" & (TxtSearch.Text) & ".jpg")
'the above line is where the program stops if no image exists...
If DataEnvironment1.rsCommand1.EOF Then
DataEnvironment1.rsCommand1.MoveFirst
End If
End If
TxtLotR.Text = "PR-"
txtrev.Text = lblrev1.Caption
TxtLotR.SetFocus
Thanks in advance