473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problems with A Hyperlink Control in a Form

LAD
1
Using Access 2003 on Windows 2000.
My Skill Level: Med Low (Some VBA, okay with Access)
Form: Single View - based on Query of single Table to sort by field.

Application: Dealers email 'contract packages' that include as attachments: a contract (PDF or TIF), a pricing tool (Excel), a companion document (Word). Clerks detach these files into a shared drive file on our intranet.

I'm building an 'contract package management' application that needs to open the different documents for viewing only from within an Access Form. I use a multi-tabbed form. The user will capture information on the first tab, then on the following tabs I'd like the user to be able to:

- easily add a link (in a text box) to the appropriate "pdf, doc, xls" as required for each record.
- open the file using the appropriate application for viewing by clicking on the Hyperlink.
The clerks are checking the documents and tracking errors in the form.

I have added a Hyperlink field in a table (ContractPackages) for each of the documents (Contract, Pricer, CompanionDoc).

I added Controls (same name as fields I.e Contract Pricer, CompanionDoc) to the Form that allows me to insert a Hyperlink to the file.

I have control over naming conventions for the files and paths of the documents. There are no blanks in the filename or path.

All Hyperlinks that I insert into the Control do not work.

The Hyperlink works immediately after inserting it into the control using the Insert Hyperlink dialog box. I can click on it and it will open Acrobat (for example) and then the file that I'm pointing to. However, if I remove focus from the control by tabbing or clicking to another control on the form, the hyperlink will not work if I go back to the control and click on the hyperlink. The arrow changes to a 'hand' when hovering, but if, for example the control contains:

..\..\..\..\..\Test_Contracts\Contract.pdf

and I click on it, the control will then display:

..\..\..\..\..\Test_Contracts\Contract.pdf#../../../../../Test_Contracts/Contract.pdf#

and nothing happens.

The Hyperlinks work when opening the table or the query and clicking on them directly. It appears that the problem lies with the Form.

I have tried:

Changing the table field type from 'Hyperlink' to 'Text'.
Changing the form control property from Hyperlink 'Yes' to 'No'
All combinations of the above two changes.

I have updated MS Office to SP3.
I have turned Unicode compression on and off in the table field.

I have dowloaded Access DB samples of Hyperlinks in forms from tech sites and compared all of the Property Settings for the field and the control and have set mine accordingly. (The test db links work fine on my computer - both with linking to local files on my drive and to files located on the Intranet shared drive).

I have researched this on many tech sites, including here, and have found no definitive answers. I would prefer not to have to write a bunch of code to use File Open dialogs when Access provides what should be a simple solution (ha!) through the use of a Hyperlink.

Any suggestions as to what might be causing this problem?

Larry
Jan 21 '08 #1
5 8769
MMcCarthy
14,534 Expert Mod 8TB
Hi Larry

The data type of the field should be hyperlink and the full path to the file should be stored. On the form the Is hyperlink property should be set to yes. That should be working.
Feb 4 '08 #2
HI Larry

I had experienced the same problem and found that to get the hyperlink working all the time, I had to include the description part of the link. You simply do this by adding the name/description before the actual path/filename, and separate the two parts with a hash (#) symbol (no spaces). Eg:
MyLinkName#C:\subfolder\myfile.pdf

Hope this helps

Regards
Rob
Feb 5 '08 #3
truthlover
107 100+
I'm having a similar problem (also using Access 2003) but what's happening is I cant get the hyperlink to open a local file. I keep getting a message saying the file name (preceeded by http://) cannot be found.

How do i get it to open a local file??

Thanks!

BTW my VBA experience is next to nothing, so please be patient with your explaination :)

HI Larry

I had experienced the same problem and found that to get the hyperlink working all the time, I had to include the description part of the link. You simply do this by adding the name/description before the actual path/filename, and separate the two parts with a hash (#) symbol (no spaces). Eg:
MyLinkName#C:\subfolder\myfile.pdf

Hope this helps

Regards
Rob
Feb 26 '08 #4
ADezii
8,834 Expert 8TB
Using Access 2003 on Windows 2000.
My Skill Level: Med Low (Some VBA, okay with Access)
Form: Single View - based on Query of single Table to sort by field.

Application: Dealers email 'contract packages' that include as attachments: a contract (PDF or TIF), a pricing tool (Excel), a companion document (Word). Clerks detach these files into a shared drive file on our intranet.

I'm building an 'contract package management' application that needs to open the different documents for viewing only from within an Access Form. I use a multi-tabbed form. The user will capture information on the first tab, then on the following tabs I'd like the user to be able to:

- easily add a link (in a text box) to the appropriate "pdf, doc, xls" as required for each record.
- open the file using the appropriate application for viewing by clicking on the Hyperlink.
The clerks are checking the documents and tracking errors in the form.

I have added a Hyperlink field in a table (ContractPackages) for each of the documents (Contract, Pricer, CompanionDoc).

I added Controls (same name as fields I.e Contract Pricer, CompanionDoc) to the Form that allows me to insert a Hyperlink to the file.

I have control over naming conventions for the files and paths of the documents. There are no blanks in the filename or path.

All Hyperlinks that I insert into the Control do not work.

The Hyperlink works immediately after inserting it into the control using the Insert Hyperlink dialog box. I can click on it and it will open Acrobat (for example) and then the file that I'm pointing to. However, if I remove focus from the control by tabbing or clicking to another control on the form, the hyperlink will not work if I go back to the control and click on the hyperlink. The arrow changes to a 'hand' when hovering, but if, for example the control contains:

..\..\..\..\..\Test_Contracts\Contract.pdf

and I click on it, the control will then display:

..\..\..\..\..\Test_Contracts\Contract.pdf#../../../../../Test_Contracts/Contract.pdf#

and nothing happens.

The Hyperlinks work when opening the table or the query and clicking on them directly. It appears that the problem lies with the Form.

I have tried:

Changing the table field type from 'Hyperlink' to 'Text'.
Changing the form control property from Hyperlink 'Yes' to 'No'
All combinations of the above two changes.

I have updated MS Office to SP3.
I have turned Unicode compression on and off in the table field.

I have dowloaded Access DB samples of Hyperlinks in forms from tech sites and compared all of the Property Settings for the field and the control and have set mine accordingly. (The test db links work fine on my computer - both with linking to local files on my drive and to files located on the Intranet shared drive).

I have researched this on many tech sites, including here, and have found no definitive answers. I would prefer not to have to write a bunch of code to use File Open dialogs when Access provides what should be a simple solution (ha!) through the use of a Hyperlink.

Any suggestions as to what might be causing this problem?

Larry
I provided a solution for a User who was having a very similar problem in dealing with Hyperlinks in general. Download the Test Database that I used to demonstrate how to Select Files, Write them to a Text Box as a Hyperlink, then Save them to the underlying Table as Hyperlinks. The code is very simple and uses the Office Dialog as the preferred Method of selection. Be sure to set a Reference to the Microsoft Office X.XX Object Library. Let me know how you make out. Good Luck!
Feb 27 '08 #5
truthlover
107 100+
Ah, my friend ADesii to the rescue again :)

Ok, this is what's happened.

First I made sure the reference was set. It was because of the image button you helped me with.

Then I tested it by picking a file with the file chooser (like the one you helped me on, and is working just fine) and the link works properly.

Then I copied a path directly into the table (to make sure the table wasnt the problem) and that link worked properly.

That left me with the previously imported links giving me an error message that the file http://my local path cant be found.

So the only two conclusions I could come up with was the table wasnt properly converting the paths (which werent originally set up as hyperlinks) or something was wrong with the imported paths -- so I did a little digging...

Because of where these links came from, I assumed the paths were accurate -- That was where the error originated. The vast majority of them are wrong in some subtle way or another. Now I just have to decide whether to leave the field as a hyperlink or just text. I'm leaning toward text because no one expects functionality out of text (it still gives them an idea where to look for the file). But a hyperlink that only works 10% of the time is going to just be annoying.

I hope you (and other readers of this post) dont view the outcome of this post as a waste of time. The process is teaching me some logical steps to more thoroughly test my work, and I find that to be invaluable. I still have a long way to go, but I am learning, right?

Thanks again for all your help and patience!



I provided a solution for a User who was having a very similar problem in dealing with Hyperlinks in general. Download the Test Database that I used to demonstrate how to Select Files, Write them to a Text Box as a Hyperlink, then Save them to the underlying Table as Hyperlinks. The code is very simple and uses the Office Dialog as the preferred Method of selection. Be sure to set a Reference to the Microsoft Office X.XX Object Library. Let me know how you make out. Good Luck!
Feb 27 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Phil | last post by:
I am looking to set up a hyperlink control on a form to retrieve letters that correspond to a record on a form. That is, there may be 100 form records, and I would like each of those form records...
3
by: hermawih | last post by:
Please help . I want to load the contents of another rtf document by double-clicking the words . Chapter1.rtf Chapter2.rtf Chapter3.rtf ....
1
by: ashoo | last post by:
Guys! I am trying to use a dropdownlist click event in my header page to link to my main page in a frameset type of form. I try to link to my main page with a hyperlink control.It works fine....
5
by: JerryK | last post by:
Hi, I am trying to put a hyperlink to a .cer (certificate) file on a form. Normally (on a ,htm page) when the user clicks on the hyperlink, the file is not recognized and the user is given the...
1
by: mschoup | last post by:
I have a simple aspx page(WebForm1.aspx) with a HyperLink, LinkButton, and two CheckBoxes. When I select a CheckBox and then click the LinkButton, the CheckBox retains state. When I select the...
4
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
2
by: Andy | last post by:
Hi, This is one of those things I thought should e easy... I'm programatically trying to set the navigateURL property in a hyperlink in the headertemplate of a repeater, but always get the...
13
ADezii
by: ADezii | last post by:
Recently, there have been several questions and much confusion concerning the Topic of Hyperlinks. Specifically, Users wanted to know how to retrieve a File Name from a FileDialog Box, copy the Name...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.