Runtime error 490 and followhyperlink

I have a form that has a function GetDirectoryFiles() and populates a listbox.  In the listbox, I see each of the files in the directory.  It's supposed to work where I can double click on a filename and it will open the file using its associated program.

Here's the problem.  When I double click on any of the jpg files that show up in the listbox, I get a runtime error 490.  It's failing at a line of code with followhyperlink.  To make things interesting, it does NOT fail with I double click on .doc files.  Anything come to mind why that would be?  The jpg files are associated with an image viewing program.  I actually changed that to use IE but it still fails.



mock5cAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

flavoCommented:
I've had a few MSisms (problems I couldn't explain) in the past with FollowHyperlink. Have you tried using the ShellExecute API?

API: Start an app with ShellExecute

(Q)    How do I start the application which is registered to handle a file extension in Win Registry?

(A)    You'll have to use the ShellExecute API.  Pass the filename to fHandleFile function.  If the file extension is "known", or registered,   it should automatically call the parent application.  If the extension is unknown, it should bring up the Windows standard "Open With" dialog box.
http://mvps.org/access/api/api0018.htm

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mock5cAuthor Commented:
Is there a limit to the length of FollowHyperlink?  As I explained, the jpg files would not open but the doc file would.  The doc file is called 1.doc.  The jpg files are 15-20 characters long.  The path where these files are located is  about 40 characters long.
mock5cAuthor Commented:
I tried to reproduce the problem on another computer but it works fine.  The problem computer has Access 2002.  The new computer has 2003.  
flavoCommented:
Have you tried the workaround I presented?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.