"Runtime error 2220
Cannot open file "C:\Project1\Tickets\2007-04BP1006.jpg" etc.
This occurs when I try to load a file that does not exist, the rest of the script seems to work fine. I have used error traps but this one escapes. my code for this section is:
Expand|Select|Wrap|Line Numbers
- Message:
- Res1 = InputBox("Please enter a valid Ticket ID to be viewed Message")
- Text1 = Res1
- Text1 = Format(Text1, ">")
- Text15 = Res1
- Me.Refresh
- If Res1 = "" Then Exit Sub
- strTicket1 = "C:\Project1\Tickets\2007-" & Text1 & ".jpg"
- strNo1 = Me.Text1
- Me.imgTicket.Picture = strTicket1
Expand|Select|Wrap|Line Numbers
- If Me.imgTicket.Picture ="(none)" Goto Message
strTicket=C:\Project1\Tickets\2007-04BP1006.jpg
if this image does not exist then
Me.imgTicket.Picture=("none")
Hopes this makes some sense to someone.
Thanks