Runtime error 2220

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Using Access 2002 have a form with the Access Image control & linking the
image to that control

Using the following code at OnCurrent event:

Dim str As String, MyImage As String

str = DLookup("SlidePath", "Admin")

' MsgBox str
' MsgBox MyImage
If Me![ImagePath] <> "" Then

MyImage = Me![ImagePath]
Me![Image].Picture = str & MyImage

EndIf

Now getting Runtime error 2220 Microsoft Access can't open the file
'D:\Test\A102.jpg'

msgbox str shows D:\test
msgbox MyImage shows \A102.jpg

Any suggestions as to what the problem is and how to overcome it would be
appreciated

TIA

Tom
 
An elementary question, perhaps, but do you actually have an image at
D:\Test\A102.jpg?
Can you open it with another application?
 
Thanks for the input - it appears it was some corruption on the form or db
as the form was redone in a new db and using the same code and now it works
OK.

So keeping our fingers crossed...

Tom
MacDermott said:
An elementary question, perhaps, but do you actually have an image at
D:\Test\A102.jpg?
Can you open it with another application?

Tom said:
Using Access 2002 have a form with the Access Image control & linking the
image to that control

Using the following code at OnCurrent event:

Dim str As String, MyImage As String

str = DLookup("SlidePath", "Admin")

' MsgBox str
' MsgBox MyImage
If Me![ImagePath] <> "" Then

MyImage = Me![ImagePath]
Me![Image].Picture = str & MyImage

EndIf

Now getting Runtime error 2220 Microsoft Access can't open the file
'D:\Test\A102.jpg'

msgbox str shows D:\test
msgbox MyImage shows \A102.jpg

Any suggestions as to what the problem is and how to overcome it would be
appreciated

TIA

Tom
 
Back
Top