Hello,
I have a problem with hyperlink.
I have a text box that contains link to the document. I enter the link by clicking on the button "add link". When I add link, the windows browser opens and i can search for exact document. But when I save the path in the Link text box, the link doent work. It is stored in News table and I changed it for hyperlink but still doesnt work. I noticed that when I am saving the path, it saves me the path as a link name that is shown in the text box, but the hyperlink path is empty.
How to make it works?
I would be grateful for help.
Greets
Greg
15 37890 ADezii 8,834
Recognized Expert Expert
Hello,
I have a problem with hyperlink.
I have a text box that contains link to the document. I enter the link by clicking on the button "add link". When I add link, the windows browser opens and i can search for exact document. But when I save the path in the Link text box, the link doent work. It is stored in News table and I changed it for hyperlink but still doesnt work. I noticed that when I am saving the path, it saves me the path as a link name that is shown in the text box, but the hyperlink path is empty.
How to make it works?
I would be grateful for help.
Greets
Greg
You cannot Add a Hyperlink to a Text Box on a Form, when you attempt this a Label containing the Hyperlink will be added to the Form, and clicking on it will Navigate to the Destination. It obviously will not be Bound or saved to a Table. If a Field in a Table is defined as Hyperlink and Links are added at the Table Level, you can then set the Control Source of a Text Box to this Field and you can activate the Hyperlink in this manner. You can also programmaticall y add a Hyperlink to a Text Box on a Form and Bind it to the underlying Field.
You cannot Add a Hyperlink to a Text Box on a Form, when you attempt this a Label containing the Hyperlink will be added to the Form, and clicking on it will Navigate to the Destination. It obviously will not be Bound or saved to a Table. If a Field in a Table is defined as Hyperlink and Links are added at the Table Level, you can then set the Control Source of a Text Box to this Field and you can activate the Hyperlink in this manner. You can also programmaticall y add a Hyperlink to a Text Box on a Form and Bind it to the underlying Field.
thank you for reply. but i think i wasnt too clear.
actually i can store this hyperlink to the table field but then i cannot open hyperlink.
Maybe i will describe it more detailed:
i have News Table where there is a News.Link field (it is set as hyperlink).
then I have News Form where I have text box - Link - which has control soucre News.Link from the News Table.
Under that Link I have button which opens browser and then in the folders on the hard drive I can choose one document. I press save and the whole path is saved on this text box Link, which is bound to News.Link.
But this paths doesnt open a hyperlink, although I set hyperlink options in Form and in Table.
Now I want to be able to open document just by clicking on that text box field in Form. Now I am clicking and nothing happens.
Do you know how to do it?
ADezii 8,834
Recognized Expert Expert
thank you for reply. but i think i wasnt too clear.
actually i can store this hyperlink to the table field but then i cannot open hyperlink.
Maybe i will describe it more detailed:
i have News Table where there is a News.Link field (it is set as hyperlink).
then I have News Form where I have text box - Link - which has control soucre News.Link from the News Table.
Under that Link I have button which opens browser and then in the folders on the hard drive I can choose one document. I press save and the whole path is saved on this text box Link, which is bound to News.Link.
But this paths doesnt open a hyperlink, although I set hyperlink options in Form and in Table.
Now I want to be able to open document just by clicking on that text box field in Form. Now I am clicking and nothing happens.
Do you know how to do it?
I answered a similar Question several weeks ago, referring to this Post should help you. The key point to remember is that a Hyperlink can consist of three Sections delimited by a '#' sign. Specifying only the URL will not work, it will simply be assigned to the Caption. Inserting a Hyperlink into a Table
I answered a similar Question several weeks ago, referring to this Post should help you. The key point to remember is that a Hyperlink can consist of three Sections delimited by a '#' sign. Specifying only the URL will not work, it will simply be assigned to the Caption. Inserting a Hyperlink into a Table
Thx for link. It sounds like the answer for my question. but i dont know how to put it to my database. I quite begginer so some things i dont understand.
So:
What is this File Dialog: msoFileDialogFi lePicker, msoFileDialogVi ewDetails
Is it module or sth like that?
I have to modules: openSavebrowser and basBrowseFiles for opening the browser and inserting the file path into the text box (but it put only the path in the text display part, not in path part).
Maybe I have wrong module (FileDialogFile Picer??). Do you have maybe codes for that FilesDialogs that are mentioned in the code from that link?
Where shall I insert that code that was in that link you gave me? I have button that is named link2. shall i put in into onclick option in Event Procedures?
greets
ADezii 8,834
Recognized Expert Expert
Thx for link. It sounds like the answer for my question. but i dont know how to put it to my database. I quite begginer so some things i dont understand.
So:
What is this File Dialog: msoFileDialogFi lePicker, msoFileDialogVi ewDetails
Is it module or sth like that?
I have to modules: openSavebrowser and basBrowseFiles for opening the browser and inserting the file path into the text box (but it put only the path in the text display part, not in path part).
Maybe I have wrong module (FileDialogFile Picer??). Do you have maybe codes for that FilesDialogs that are mentioned in the code from that link?
Where shall I insert that code that was in that link you gave me? I have button that is named link2. shall i put in into onclick option in Event Procedures?
greets
The Link that I provided for you also shows sample FileDialog code.
The Link that I provided for you also shows sample FileDialog code.
I saw that code but i dont know exactly how to change it...
msoFileDialogFi lePicker, msoFileDialogVi ewDetails - i dont know my equivalent of thos fields...
are there modules codes or sth else???...
I will follow that sample you gave on my example, and if you could check if this is correct i would be greatful:
What is the Field Name? Link
Is this Field defined as a Hyperlink Data Type in the Table? YES
What is the Table's Name? NEWS
What URL are you trying to Update the Field to? (Microsoft.com, Google.com, TheScripts.com, etc.) I have text box: Link which is bound to [News].[Link] field.
Now what i need is to be able to add paths of files into Link field as a hyperlink path.
So where should i put this code: -
Dim varItem As Variant
-
-
With Application.FileDialog(msoFileDialogFilePicker) what should i put into msoFileDialogPicker??
-
-
With .Filters
-
.Clear
-
.Add "Text Files", "*.txt"
-
.Add "Database Files", "*.mdb"
-
.Add "All Files", "*.*"
-
End With
-
'The Show Method returns True if 1 or more files are selected
-
.AllowMultiSelect = True
-
.FilterIndex = 2 'Database files
-
.ButtonName = "Link2"
-
.InitialFileName = vbNullString
-
.InitialView = msoFileDialogViewDetails' (and what is that FiledDialogViewDetails?? )
-
-
.Title = "Find the damn File!"
-
If .Show Then
-
For Each varItem In .SelectedItems 'There will only be 1
-
Me![Link] = varItem
-
Next varItem
-
End If
-
End With
I am quite lost with that and i dont know how to proceed further...
greets
Greg
ADezii 8,834
Recognized Expert Expert
I saw that code but i dont know exactly how to change it...
msoFileDialogFi lePicker, msoFileDialogVi ewDetails - i dont know my equivalent of thos fields...
are there modules codes or sth else???...
I will follow that sample you gave on my example, and if you could check if this is correct i would be greatful:
What is the Field Name? Link
Is this Field defined as a Hyperlink Data Type in the Table? YES
What is the Table's Name? NEWS
What URL are you trying to Update the Field to? (Microsoft.com, Google.com, TheScripts.com, etc.) I have text box: Link which is bound to [News].[Link] field.
Now what i need is to be able to add paths of files into Link field as a hyperlink path.
So where should i put this code: -
Dim varItem As Variant
-
-
With Application.FileDialog(msoFileDialogFilePicker) what should i put into msoFileDialogPicker??
-
-
With .Filters
-
.Clear
-
.Add "Text Files", "*.txt"
-
.Add "Database Files", "*.mdb"
-
.Add "All Files", "*.*"
-
End With
-
'The Show Method returns True if 1 or more files are selected
-
.AllowMultiSelect = True
-
.FilterIndex = 2 'Database files
-
.ButtonName = "Link2"
-
.InitialFileName = vbNullString
-
.InitialView = msoFileDialogViewDetails '(and what is that FiledDialogViewDetails?? )
-
-
.Title = "Find the damn File!"
-
If .Show Then
-
For Each varItem In .SelectedItems 'There will only be 1
-
Me![Link] = varItem
-
Next varItem
-
End If
-
End With
I am quite lost with that and i dont know how to proceed further...
greets
Greg
Don't have the time right now but I'll give you step-by-step detailed information as soon as I get the chance, hopefully tonight.
Don't have the time right now but I'll give you step-by-step detailed information as soon as I get the chance, hopefully tonight.
ok no problem. i will check it tommorow then. thx
ADezii 8,834
Recognized Expert Expert
ok no problem. i will check it tommorow then. thx
The following code, placed in the Click() Event of a Command Button named cmdPopulateHype rlink will:- Open a File Dialog Box, and allow you to select only 1 File of any type.
- Allow you to customize the Button and Dialog Title Captions within the File Dialog Box.
- Write the Hyperlink Caption and Address (both are required) to the Link Text Box on the Current Form. The Control Source for this Link Text Box is the [Link] Field.
- The Record Source for the Form is the Table News.
- The code has been thoroughly tested and is fully functional. I inserted Comments where I thought they may be needed.
- Any questions, feel free to ask.
-
Private Sub cmdPopulateHyperlink_Click()
-
'First, set a Reference to the Microsoft Office XX.X Object Library
-
-
Dim strButtonCaption As String, strDialogTitle As String
-
Dim strHyperlinkFile As String
-
-
'Define your own Captions if necessary
-
strButtonCaption = "Save Hyperlink"
-
strDialogTitle = "Select File to Create Hyperlink to"
-
-
With Application.FileDialog(msoFileDialogFilePicker)
-
With .Filters
-
.Clear
-
.Add "All Files", "*.*" 'Allow ALL File types
-
End With
-
'The Show Method returns True if 1 or more files are selected
-
.AllowMultiSelect = False 'Critical Line
-
.FilterIndex = 1 'Database files
-
.ButtonName = strButtonCaption
-
.InitialFileName = vbNullString
-
.InitialView = msoFileDialogViewDetails 'Detailed View
-
.Title = strDialogTitle
-
If .Show Then
-
For Each varItem In .SelectedItems 'There will only be 1
-
'Caption and Address of Hyperlink will be the same (Caption#Address)
-
strHyperlinkFile = varItem & "#" & varItem
-
Me![Link] = strHyperlinkFile
-
Next varItem
-
End If
-
End With
-
End Sub
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tero Partanen |
last post by:
Hello!
I'm writing about a rather peculiar problem I'm having with
Access2000.
I have a table in which I have created one hyperlink-type field. I
have given the field a default value which is an email-address. The
default value is (for example): "mailto:mymail@here.com".
Access2000 correctly inserts that information into the field everytime
|
by: Paul |
last post by:
Hi I have a data grid with a hyperlink column. the colum has numbers like
00001,000002, ect. Just wondering how to get the text value of the cell as
tempstring = datagrid.Items(rownumber).Cells.Item(column number).Text
returns a blank string. It seems to work ok for the other columns that are
just regular datagrid columns, not hyperlink types.
Thanks.
--
Paul G
Software engineer.
|
by: Joe |
last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first
column contains hyperlinks. When a user clicks one of these hyperlinks, he
will navigate to another aspx page (referred to here as page_2). I need to
cache the value of the link's text (hyperlink.text property) so that I can
use it in the page_load event of page_2.
I've thought of using a hidden field and then calling
Request.Form("hdnClickedLinkText") in the...
|
by: Keith Wilby |
last post by:
I have a personnel database with a hyperlink field which contains the path
to a mugshot. I was thinking of combining the hyperlink field with the
surname field by putting the surname in the "Display Text" of the hyperlink.
I have 200 or so existing records - can this be done either with code or in
a query? I'm not sure of the syntax to use to reference the "Display Text"
property (if it can be done at all).
Many thanks.
Keith.
|
by: tshad |
last post by:
I had posted this problem earlier and just noticed that the Hyperlink is the
problem.
Apparently, it doesn't figure out the path correctly. It uses the path of
the file it is in, even if it is a control.
I have 2 files "displayCompanyJobs.aspx" and "displayCompanyOverview.aspx"
which are in both the folder "/jobseeker/" and "/employer/".
I have a user control "displayCompanyJobs.ascx" that is in my /applicant/
| |
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 to a Bound Text Box on a Form, and save the Hyperlink to the underlying Table. The code demos below will do just that: retrieve the Absolute Path of of File from a FileDialog Box, use the Base Name (no extension) as the Display Text for the...
|
by: k lee |
last post by:
I want to create a linkButton to activate my hyperlink which will open a new page in a new window. I would like to know how to code the code of activate the hyperlink which I wish to place it in the 'onclick' event of the linkButton.
|
by: suvaline |
last post by:
I dont know much about VBA, but maybe somebody can help me ;)
I have this kind of SUB ..
Sub kama2()
Worksheets("kama").Activate
Range("A51").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Application.WindowState = xlNormal
Start_Timer
End Sub
... and question ...
|
by: sierra7 |
last post by:
I'm trying to create a form where a user enters a document reference number and then clicks a command button to add a hyperlink to the document, via a file picker.
Thanks to Adezii's excellent article http://bytes.com/topic/access/answers/725778-inserting-hyperlink-into-table I can manage to create a hyperlink to the document and store it in the table, but it is the full hyperlink path not the reference number of the document that is...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |