I am trying to work around a problem where I can avoid the following message:
"Runtime error 2220
Cannot open file "C:\Project1\Ti ckets\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:
[CODE=vb] Message:
Res1 = InputBox("Pleas e 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\Ti ckets\2007-" & Text1 & ".jpg"
strNo1 = Me.Text1
Me.imgTicket.Pi cture = strTicket1
[/CODE] I want to be able to reintroduce the InputBox when Me.imgTicket.Pi cture = "(none)", anyone have any ideas on how I can acieve this, as currently if I put:
[CODE=vb] If Me.imgTicket.Pi cture ="(none)" Goto Message[/CODE]
Nothing happens (apart from the 2220 error message) as it is too late to catch the error! its already happened ie
strTicket=C:\Pr oject1\Tickets\ 2007-04BP1006.jpg
if this image does not exist then
Me.imgTicket.Pi cture=("none")
Hopes this makes some sense to someone.
Thanks
"Runtime error 2220
Cannot open file "C:\Project1\Ti ckets\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:
[CODE=vb] Message:
Res1 = InputBox("Pleas e 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\Ti ckets\2007-" & Text1 & ".jpg"
strNo1 = Me.Text1
Me.imgTicket.Pi cture = strTicket1
[/CODE] I want to be able to reintroduce the InputBox when Me.imgTicket.Pi cture = "(none)", anyone have any ideas on how I can acieve this, as currently if I put:
[CODE=vb] If Me.imgTicket.Pi cture ="(none)" Goto Message[/CODE]
Nothing happens (apart from the 2220 error message) as it is too late to catch the error! its already happened ie
strTicket=C:\Pr oject1\Tickets\ 2007-04BP1006.jpg
if this image does not exist then
Me.imgTicket.Pi cture=("none")
Hopes this makes some sense to someone.
Thanks
Comment