473,665 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing the data type of a field to hyperlink

I have an Excel spreadsheet containing a column of hyperlinks that I
need to import into Access. I have no trouble importing (in my case
actually linking) the spreadhsheet to the Access table, however the
column of hyperlinks lose their URL's in transit and no longer are
active links. To try and fix the problem I am using this bit of code
in my Excel spreadsheet to copy the URL of each hyperlink into a new
column that can then be imported into Access:

'Code Starts
Public Function GetURL(R As Range) As Variant
If R.Hyperlinks.Co unt > 0 Then
GetURL = R.Hyperlinks(1) .Address
Else
GetURL = Null
End If
Set C = Nothing
End Function
'Code Ends

The only thing I need help with is figuring out how to change the data
type of this URL field to "hyperlink" once it has been imported. I
know how to do this manually but for the purpose of my database I will
need to do this by VB coding. Any help would be much appreciated!

Jun 6 '06 #1
3 4931
In your Access table, is the field itself defined as a Hyperlink? I would
think that would take care of it.
Jun 6 '06 #2

Rick Wannall wrote:
In your Access table, is the field itself defined as a Hyperlink? I would
think that would take care of it.


That's the thing....when access imports the table it defines the field
as text but I need to change it to hyperlink via code.

Jun 6 '06 #3
From Access Help:

(Field) Type Property
Sets or returns a value that indicates the operational type or data type of
an object.
Settings and Return Values
The setting or return value is a constant that indicates an operational or
data type. For a Field <daobjfield.htm > or Property <daobjproperty. htm>
object, this property is read/write until the object is appended to a
collection or to another object, after which it's read-only. For a QueryDef
<daobjquerydef. htm>, Recordset <daobjrecordset .htm>, or Workspace
<daobjworkspace .htm> object, the property setting is read-only.

Can't change the type of a field after it's in the table.

You can create a new field, any type you like (in this case hyperlink), add
that to your table, and then copy the values from the text field to the
hyper link column. Code for the field creation, one action query to copy
the values.

Since, however, you can specify code in a form that will follow a hyperlink
even from a text field you may not actually need to do this, unless you just
have to have the ability to click on the address in a datasheet and follow
the link.
Jun 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6497
by: iporter | last post by:
Hi - I am changing a field from type nvarchar to type text, given that I need to store strings longer than 255 characters. To do this I change the data type in SQL Server, then I change the parameter code in the calling procedure, as per below: cmd.Parameters.Append(cmd.CreateParameter("@title", adVarWChar, adParamInput, 255, title)); becomes:
13
2906
by: Peter | last post by:
Can anyone tell me how to change the data type of a field in a table created with a make table query? The field is a binary and must be changed to text. alternately does anyone know how to specify the field type when running a make table query? Thanks, Sven
2
2058
by: S P Arif Sahari Wibowo | last post by:
Hi! Do you know how to put a form's Access-Visual-Basic-code that will force the form to be inserted, while the user has not type anything in the form, without changing focus, selection, etc.? Here is the story. I have this structure:
4
7531
by: Andreas Meffert | last post by:
Hello, How can I change the Type of a field in a table from Memo to hyperlink? I import a table from Oracle to Access 2003. After that, the field type of some hyperlink-fields is "Memo". How can I schwitch back to Hyperlink via VBA because its boring doing it manually often (I import the table each week for doing updates). When I do it manually the hyperlink works well. Thanks in advance.
0
1788
by: Scott | last post by:
I have a search form built with Access 97 and now I upgraded to Access 2003. On one field of the resulting form, I have a field of hyperlink data type containing the path of the file, i.e., Disk P001\ABC doc 12-01.tif. I use the same data entry procedure to insert a hyperlink and got .../Disk%20P001/ABC%20doc%2012-01.tif. Now I got the problem that all the hyperlink entered with Access 97 cannot open the file and the error message was:-...
7
2369
by: JR123 | last post by:
I need some help. When the user enters a number if there is a match I want it to display as a hyperlink to that specific section of an intranet site we have at work. I have quite a lot of data but have only put a few entries on as a example and not sure how to get it to display as a link. <html> <head> <TITLE>number Search</TITLE> <script type="text/javascript"> var numbers = {"^{3}$" : "Google", "^S{3}$" : "Yahoo",...
1
1667
by: JB | last post by:
I have a set of links that are currently images that when the person rolls over them, they change color. Essentially the image is a box where the background is brown and the text is blue. When the person rolls over it, they want it blue background with brown text. As I said we currently do images but that is annoying. Is there an easy way ( or at least relatively easy ) way to do this just using text and javascript to change the colors?...
1
2697
by: rishiv | last post by:
Hi, I'm using MS Access 2002 SP3 & Visual Basic 6.3 on WinXP Home SP2. I have a table of condition data (5990 records) that relates to information stored in a proprietary application. The primary key in my table (MyKey) is the same as the key used to find data in the other windows application (C:\Folder\My.exe). So, if I am looking at a record in my table, say with ID = 100, I can view further information and images etc in my application...
13
2127
by: Desitech | last post by:
I want to create a command button on a form that will populate a certain field in a certain table for that record with a hyperlink address (just the text) and add another field from that record to the string. For Example: On Click, fill the field in the Table "ASSEMBLY" with W:\engineering\PRODUCT ENGINEERING\ASSEMBLY\PDF\ .pdf field data from record entitled The data in that field is A-2000-1 So the DRAWING HYPERLINK field in...
0
8348
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,...
0
8863
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, 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...
0
8779
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 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...
1
8549
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
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 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...
0
5660
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();...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
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
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.