From: Tom on
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


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

"Tom" <Tom(a)NoSpam.com> wrote in message
news:eAuQcxVEFHA.3376(a)TK2MSFTNGP12.phx.gbl...
> 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
>
>


From: Tom on
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" <macdermott(a)NoSpam.com> wrote in message
news:%23DsbGMeEFHA.1836(a)tk2msftngp13.phx.gbl...
> An elementary question, perhaps, but do you actually have an image at
> D:\Test\A102.jpg?
> Can you open it with another application?
>
> "Tom" <Tom(a)NoSpam.com> wrote in message
> news:eAuQcxVEFHA.3376(a)TK2MSFTNGP12.phx.gbl...
>> 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
>>
>>
>
>