By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,657 Members | 774 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,657 IT Pros & Developers. It's quick & easy.

Field Type changing to hyperlink via VBA

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.