Need code to Open a BROWSER and view an HTML file


I have a query that displays a column called description that includes html text.
Is there a way that I can view the code using a browser by clicking on the specific cell that I want to view?

I read an older message board posting from one user who said there is a way to do this using an OLE Object type of table cell.  I've also wondered whether I might use the hyperlink cell type.

If this is not possible, I have already written code to save a file on the disk at C:\mytempfolder\exportfile.html and can get by if I get code to open the file with a browser.

Your help is always appreciated

'm using MS Access 2000, XP Pro
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.

I don't use the hyperlink data type, mostly because it isn't supported by SQL Server.  I just use a text data type and set the FormatAsHyperlink property to always.  Then in the click or dbl-click event, use the FollowHyperlink Method to open the document.  This will open whatever app is set as the Windows default for this particular file extension.  If the default doesn't work for you, you can use Shell but you will need to know what application you want to open and where it is so this method can cause issues if your users don't have consistent software and install locations.  So start with the FollowHyperlink because it relies on defaults.
pcalabriaAuthor Commented:
Perhaps you can explain a bit further...

I currently have a column called Description in a query that contains HTLM code.

Is FormatAsHyperlink a property of the query?  If so, where is it and is it supported in Access 2k?

Also, what do mean by FollowAsHyprelink method?  I've used that before to link to urls, will it work for a file on my hard drive?
You can't do any of this in the query.  You need to open a form bound to the query because we are talking about properties of controls on a form and code that you execute in events and none of those apply to queries.

The FollowHyperlink method works for any file type as long as it is registered with Windows so Windows knows what program is defined as the default for when you double-click on a file of that type.  So, if you double-click on a file and some app opens up the document, then FollowHyperlink will work.  If Windows asks you what program you want to use, then FollowHyperlink will not work.  To make it work, you need to create a new association.  For example, you can associate notepad with file extension = .abc.  Then if you double-click on, Notepad is launched and will try to open the specified file.  I use FollowHyperlink all the time to open documents that my users "attach" to an audit.  This method frees me from having to use Shell where I would have to know the path to the executable.  So, if I wanted to open a .doc file using Shell, I would need the path to the MSWord.exe file and that means I would also need to know the version since versions are typically loaded into different folders.

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
pcalabriaAuthor Commented:
Thanks!  Works great!
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.