473,511 Members | 16,260 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Field Type changing to hyperlink via VBA

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.
Regards
Andreas
Nov 13 '05 #1
4 7506
Andreas:

You can access the data through the Type property of the Field object in
DAO. However, once the table is created, this property becomes read-only.
"Andreas Meffert" <an*********@gmx.de> wrote in message
news:42*********************@businessnews.de.uu.ne t...
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.
Regards
Andreas

Nov 13 '05 #2
A Hyperlink field is a Memo type field, with the Attributes set to:
dbHyperlinkField + dbVariableField
but I don't think Access will let you change the attributes for an existing
field.

To set up the field programmatically would therefore consist of these steps:

1. CreateField() to make a new field of type dbMemo, set the Attribributes,
and Append to the Field of the TableDef.

2. Exeute an Update query statement to update the new hyperlink field with
the contents of the memo field, making sure you include the two # characters
between the components of the hyperlink.

3. Execute a DDL query statement to get rid of the original text field:
"ALTER TABLE MyTable DROP COLUMN MyMemo;"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Andreas Meffert" <an*********@gmx.de> wrote in message
news:42*********************@businessnews.de.uu.ne t...

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.

Nov 13 '05 #3
Hyperlink fields in Access are problematic to begin with. Add ODBC links, and
they're just plain broken. Controls bound to them still appear in blue with
an underline, they no longer act like links.

What I generally do is simply give up on the hyperlink field altogether, and
just store URLs in text fields. You can use the click or double-click event
for the control and call FollowHyperlink from VB to actually open the target.

On Wed, 4 May 2005 16:14:23 +0200, "Andreas Meffert" <an*********@gmx.de>
wrote:
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.
Regards
Andreas


Nov 13 '05 #4
Steve Jorgensen wrote:
Hyperlink fields in Access are problematic to begin with. Add ODBC links, and
they're just plain broken. Controls bound to them still appear in blue with
an underline, they no longer act like links.

What I generally do is simply give up on the hyperlink field altogether, and
just store URLs in text fields. You can use the click or double-click event
for the control and call FollowHyperlink from VB to actually open the target.


I'm glad you posted this because this is what I do too, and I was
wondering between Why am I doing it that way and What have I missed in
not finding hyperlink fields so convenient to work with.

--
--
Lyle

"The aim of those who try to control thought is always the same. They
find one single explanation of the world, one system of thought and
action that will (they believe) cover everything; and then they try to
impose that on all thinking people."
- Gilbert Highet
Nov 13 '05 #5

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

Similar topics

3
6450
by: kingofkolt | last post by:
All, What do you recommend as the best type of field for a timestamp in a MySQL database? I've considered varchar(10) or INT but I'm not sure what is the best, most efficient, and most reliable...
7
6761
by: Galina | last post by:
Hello I am going to copy a data from MS Access table into Oracle table. One of fields is memo type and data in this field range from 1 character to 551 long string. Do I need to create a field...
2
1383
by: William Gill | last post by:
When I designed my db in several tables I used unsigned integer fields to hold an integer that each bit was a 'flag'. Now I realize that the set field type does just what I was trying to...
7
3503
by: Együd Csaba | last post by:
Hi, I've a problem with some of my stored procs. My config is: RH7.1, Postgres 7.3.2 I had converted a few fields of a few tables from one type to another and after this I made all the...
6
3376
by: MLH | last post by:
I have this little snippet running whenever I want to list my table field names in the debug window, along with their field types... For i = 0 To TempRecordset.Fields.Count - 1 Debug.Print...
1
1738
by: Henry Stockbridge | last post by:
I am doing some database documentation, and need to convert the field type and field formats in my code into terms I can convey to others (i.e. Date/Short Date, Number/Double, and so forth.) Any...
1
2300
by: ciruliz ciruliz | last post by:
In Excel there is one greate feature - I can create table with ole object field type & put excel document in it, then in table view when double-clicking on that field , excel document opens in...
17
4003
by: The Frog | last post by:
Hello everyone, I am working on an application that can build database objects in MS Access from text files. I suppose you could call it a backup and restore type routine. Accessing the...
6
7352
RobH
by: RobH | last post by:
I need to change the field type in a linked table from Text to Memo. Any thoughts?
0
7242
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
7138
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
7353
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
7508
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
5063
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
4737
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...
0
3212
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
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 ...
1
781
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.