Group:  Microsoft Access » microsoft.public.access.formscoding
Thread: Linked Image

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Linked Image
Daniel 07.09.2006 15:51:02
Good morning,

I have a linked image on a form. However, I am not working on my work
network and as such keep getting error about the db not being able to open
'Image path'. is there a way to trap this error? i have tried using the
Load event of the form but it didn't catch this error?!

Thank you for your help,

Daniel
Re: Linked Image
"Nick 'The database Guy'" <nick.mcmillen[ at ]eads.com> 07.09.2006 16:33:43
Hi Daniel,

You have two choices:

i) Make a copy of the database, in the copy delete the references to
the stuff at work, then copy and paste all the items you have updated
in to the 'work' copy.

ii) You could also write and error handler that told the code to carry
on uninterupted if that error occurs.

I prefer the second option myself.

Good luck,

Nick
Daniel wrote:
[Quoted Text]
> Good morning,
>
> I have a linked image on a form. However, I am not working on my work
> network and as such keep getting error about the db not being able to open
> 'Image path'. is there a way to trap this error? i have tried using the
> Load event of the form but it didn't catch this error?!
>
> Thank you for your help,
>
> Daniel

Re: Linked Image
Daniel 07.09.2006 17:28:01
ii) this is what I am trying to do but the error doesn't seem to get raised
by any events that I've used. I've tried Activate, Open, Load... none seem
to trap the eeror being generated? Any ideas?

Thanks,

Daniel





"Nick 'The database Guy'" wrote:

[Quoted Text]
> Hi Daniel,
>
> You have two choices:
>
> i) Make a copy of the database, in the copy delete the references to
> the stuff at work, then copy and paste all the items you have updated
> in to the 'work' copy.
>
> ii) You could also write and error handler that told the code to carry
> on uninterupted if that error occurs.
>
> I prefer the second option myself.
>
> Good luck,
>
> Nick
> Daniel wrote:
> > Good morning,
> >
> > I have a linked image on a form. However, I am not working on my work
> > network and as such keep getting error about the db not being able to open
> > 'Image path'. is there a way to trap this error? i have tried using the
> > Load event of the form but it didn't catch this error?!
> >
> > Thank you for your help,
> >
> > Daniel
>
>
Re: Linked Image
pietlinden[ at ]hotmail.com 07.09.2006 21:09:18

Daniel wrote:
[Quoted Text]
> Good morning,
>
> I have a linked image on a form. However, I am not working on my work
> network and as such keep getting error about the db not being able to open
> 'Image path'. is there a way to trap this error? i have tried using the
> Load event of the form but it didn't catch this error?!
>
> Thank you for your help,
>
> Daniel

Sorry, I'm writing this and then searching, so my answer is backwards.
(Watch Memento a few times and hopefully this post will be easier to
understand...)

Okay, I found it. I _knew_ it had to be there!!!
http://vbnet.mvps.org/code/network/isnetworkalive.htm

So you'd have the code from Randy's site to tell you if the network you
need to connect to is available. Then I suppose you could do something
like

IF IsNetConnectionAlive() Then
strImagePath="\\Servername\directory\subdirectory\image.jpg"
Else
strImagePath=App.Path & "\" & "offnetwork.jpg"
End If

Gross simplification, I'm sure, but the general idea is to check the
network connection before you open all your forms and have them respond
appropriately. If IsNetworkAlive is False, then just load images from
a local directory or set the path to the images to a different place.
(Basically deal with the error gracefully instead of making the user
wonder what's going on.)

Hope this helps a little bit.

Pieter

Re: Linked Image
"bob" <exponent[ at ]hotmail.com> 07.09.2006 21:45:53


If you’re using an Image Control, check that the images are accessible before assigning the path:

If Len(Dir(ImagePath)) > 0 Then
Image1.Picture = ImagePath
Else
Image1.Picture = ""
End If


--
_______________________________________________________
The Access Image FAQ
http://www.ammara.com/access_image_faq/




=?Utf-8?B?RGFuaWVs?= <Daniel[ at ]discussions.microsoft.com> wrote:
[Quoted Text]
>Good morning,
>
>I have a linked image on a form. However, I am not working on my work
>network and as such keep getting error about the db not being able to open
>'Image path'. is there a way to trap this error? i have tried using the
>Load event of the form but it didn't catch this error?!
>
>Thank you for your help,
>
>Daniel

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net