473,396 Members | 1,864 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,396 software developers and data experts.

Hyperlink Problem

PhilOfWalton
1,430 Expert 1GB
I have Hyperlinks in 2 tables, both work absolutely normally.
These 2 tables (and others) get combined and end up in a form.
One hyperlink works correctly.

The other one, when I click on it, appends a hash "#" at both begining and and of the link and nothing happens.

Usually, when I click on another field, the Hashes disappear.

If I right click on the link and select Open Hyperlink, all works OK.

There is no code associated with this field.

I have used this program, unaltered for years and this is a recent problem.

Interestingly, in a totally different part of the program, using VBA, I open the website, extract some data to load into Access with no problem.

Any ideas please?

Phil
Jul 18 '16 #1

✓ answered by jforbes

I don't use the IsHyperlink Property. There are a lot of different places throughout our databases that I would want to launch a URL, so I use the same Function to launch them regardless of how the URL is provided. Part of that single launch point approach is to more tightly control how the URL is launched instead of just giving control over to Access to do as it wants with it. I can't remember the details, but Access would do some strange things from time to time. ... maybe it's what you are running into.

Using a single launch point in the case of a Datasheet, for the URL field, the ForeColor is set to Blue and the Text is Underlined so that it looks like a Hyperlink to the user. They just think it's a hyperlink and they don't give it a second thought. Then in the OnClick for the Field it calls the same function that is used through the database to open an attachment.

This is the function I use with some of our database specific stuff ripped out (Actually a lot ripped out, so hopefully it didn't introduce errors). It doesn't look as complicated this way, but you should get the point:
Expand|Select|Wrap|Line Numbers
  1. Function OpenAttachment(ByVal sTargetAndLocation As String) As Boolean
  2.  
  3.     Dim dTaskID As Double
  4.  
  5.     OpenAttachment = False
  6.  
  7.     If InStr(sTargetAndLocation, "http") > 0 Then
  8.         FollowHyperlink (sTargetAndLocation)
  9.         OpenAttachment = True
  10.     Else
  11.         dTaskID = Shell("explorer.exe "& sTargetAndLocation, vbNormalFocus)
  12.         OpenAttachment = (dTaskID >= 0)
  13.     End If
  14.  
  15. End Function

9 1177
jforbes
1,107 Expert 1GB
That's weird, sounds like it is getting formatted as a Date somehow. Do you have some code that you can provide that is used to launch the Hyperlink?
Jul 18 '16 #2
PhilOfWalton
1,430 Expert 1GB
Thanks for quick reply.
No code used - no code needed (it works in the table)
Format is "Plain Text"
Display as Hyperlink is "If Hyperlink"

BE database compacted / repaired
FE database decompiled compacted / repaired

Phil
Jul 18 '16 #3
jforbes
1,107 Expert 1GB
I don't use the IsHyperlink Property. There are a lot of different places throughout our databases that I would want to launch a URL, so I use the same Function to launch them regardless of how the URL is provided. Part of that single launch point approach is to more tightly control how the URL is launched instead of just giving control over to Access to do as it wants with it. I can't remember the details, but Access would do some strange things from time to time. ... maybe it's what you are running into.

Using a single launch point in the case of a Datasheet, for the URL field, the ForeColor is set to Blue and the Text is Underlined so that it looks like a Hyperlink to the user. They just think it's a hyperlink and they don't give it a second thought. Then in the OnClick for the Field it calls the same function that is used through the database to open an attachment.

This is the function I use with some of our database specific stuff ripped out (Actually a lot ripped out, so hopefully it didn't introduce errors). It doesn't look as complicated this way, but you should get the point:
Expand|Select|Wrap|Line Numbers
  1. Function OpenAttachment(ByVal sTargetAndLocation As String) As Boolean
  2.  
  3.     Dim dTaskID As Double
  4.  
  5.     OpenAttachment = False
  6.  
  7.     If InStr(sTargetAndLocation, "http") > 0 Then
  8.         FollowHyperlink (sTargetAndLocation)
  9.         OpenAttachment = True
  10.     Else
  11.         dTaskID = Shell("explorer.exe "& sTargetAndLocation, vbNormalFocus)
  12.         OpenAttachment = (dTaskID >= 0)
  13.     End If
  14.  
  15. End Function
Jul 18 '16 #4
ADezii
8,834 Expert 8TB
Thye '#' Symbol serves as a Delimiter for the various Components of a Hyperlink Field, namely: displaytext#address#subaddress#screentip. Under certain circumstances such as when you are typing an address part directly into a Hyperlink field, Microsoft Access adds the two # symbols that delimit parts of the hyperlink data. In effect it attempts to seperate the displaytext, address, and subaddress Components. This appears to be what is happening here. How, exactly, are the 2 Tables combined, specifically the Hyperlink Fields?
Jul 18 '16 #5
PhilOfWalton
1,430 Expert 1GB
Firstly thanks to both for replying
Jforbes solution works perfectly, and I may well adopt it, but for the moment I am trying to understand why the problem has arisen.

So to answer ADezii,
3 tables .. only relevant fields shown
Expand|Select|Wrap|Line Numbers
  1. TblSuppliers
  2.     AccID      Auto   PK
  3.     AccName    Text
  4.     AccWevsite Hyperlink
  5.  
  6. TblJAccInvestments
  7.     InvestmentID  Long Joint FK
  8.     AccID         Long  Joint FK
  9.  
  10.  
Jul 18 '16 #6
PhilOfWalton
1,430 Expert 1GB
Sorry, hit the wrong button and half a message got sent.
Will try again
Expand|Select|Wrap|Line Numbers
  1.  
  2. TblSuppliers
  3.     AccID           Auto   PK
  4.     AccName         Text
  5.     AccWebsite      Hyperlink
  6.  
  7. TblJAccInvestments
  8.     InvestmentID    Long Joint FK
  9.     AccID           Long Joint FK
  10.  
  11. TblInvesments
  12.     InvestmentID    Auto   PK
  13.     InvestmentName  Text
  14.     WebPage         Hyperlink
  15.  
This is set up as a many to many relationship, and the form basically shows the Investment and the associated Supplier.
The Hyperlink for the supplier works perfectly, but the WebPage Hyperlink displays the symptoms above.

To try to get further I added a field "WebText" to the TblInvestments and ran the following update query to try to see what was in the WebPage Hyperlink

Expand|Select|Wrap|Line Numbers
  1.  
  2. UPDATE TblInvestments SET TblInvestments.WebText = [WebPage]
  3. WHERE ((Not (TblInvestments.WebPage) Is Null));
  4.  
Not sure what I should see, but a typical examply is the the Hyperlink field I have
https://uk.finance.yahoo.com/q/?s=BNC.L
and the corresponding text field has
#Https://uk.finance.yahoo.com/q/?s=BNC.L#

Somehow I expected to see more.
Incidentally, the Hyperlink in the query works as expected.

NB On this website both are showing as Hyperlinks. The latter one should just be plain text.

Phil
Jul 18 '16 #7
ADezii
8,834 Expert 8TB
Odd problem, I'll see if I can reproduce this anomaly tomorrow when I will recreate the DB.
Jul 18 '16 #8
PhilOfWalton
1,430 Expert 1GB
I think you will struggle to reproduce it. As I said, it has worked for many months now, but thanks for having a go.

Phil
Jul 18 '16 #9
PhilOfWalton
1,430 Expert 1GB
Sorry for late reply, I was hoping things would sort themselves out, but alas no.

So I have gone for jforbes elegant solution which works perfectly.

Thanks again

Phil
Jul 26 '16 #10

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

Similar topics

0
by: Ray | last post by:
I've got a Database Results Wizard form with a hyperlink which passes data onto the next page. I wish to send two pieces of data along this link. The first item is from within the DRW data, so I...
0
by: Cillies | last post by:
Hi, On one of the forms in my access database I have created a hyperlink. This hyperlink opens saved emails for each record. The link initally works fine, but when I re-open the database I get...
3
by: Doug Swanson | last post by:
So I've added a hyperlink to a screen based on a url stored in a database. The problem is that the hyperlink text is not underlined....but it becomes underlined when you hover over it. Small thing...
1
by: Sunil Sabir | last post by:
Dear All, I am actually trying to open a new window from my Hyperlink control. Below is the code: Hyperlink .NavigateUrl =...
1
by: tarsem | last post by:
if ($agegroup == "Minor") $link='<a href="php.php?q='.$_POST.'&p'=.$_POST.'">Minor </a>'; i can't get "name" on php.php
1
by: mister-Ed | last post by:
I am displaying subcategories in my datalist, and now I have a bizarre thing happen when I add a new subcategory record in my sql database, the new subcategory link does not click into the next...
1
by: shivendravikramsingh | last post by:
hi friend,i have a problem,actually i used a hyperlink in a text in a flash .fla file.its work fine when i test the movie.but when i publish the file.it does't work.i have given the url: of google...
10
by: octavian79ad | last post by:
This is the backend switch: <?php switch ($_GET) { case "Global SEO Services"; $url = "http://www.globalseoservices.com"; ob_end_clean(); header("Location:...
1
by: chambersdon | last post by:
I have 2 projects, in the same Visual Studio solution, with hyperlinks between them. These are file system projects that use the Visual Studio Web Server, not my local IIS. When the Visual Studio...
3
by: Phasma | last post by:
Hi I'm pretty new to access and am a bit stuck on the following. I have a table which contains a field called and is set to hyperlink. The form I use to input data has a text box bound to this...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.