473,507 Members | 2,379 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.Count > 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 4920
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
6460
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...
13
2885
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...
2
2041
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.? ...
4
7504
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...
0
1778
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...
7
2358
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...
1
1663
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...
1
2675
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...
13
2105
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...
0
7111
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
7319
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,...
1
7031
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
7485
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...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1542
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 ...
0
412
bsmnconsultancy
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...

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.