Runtime error 2220

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
 
M

MacDermott

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

Tom

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top