How to have text field store hyperlink information

  • Thread starter osupratt via AccessMonster.com
  • Start date
O

osupratt via AccessMonster.com

I have a table where I would like to store hyperlink information. This table
is a linked table to sql server. There is no hyperlink datatype in sql server.
So I have a field VARCHAR named sqlHyperlink. Of course I can't change this
to data type hyperlink in Access because it is linked. Is there anyone who
would know how I can set a text box up on a form with a browse button to look
for the user to search for a file and once selected store this 'link'
information in the text field?

Any help would be greatly appreciated. Thanks.
 
A

Allen Browne

Can I suggest storing this information as 2 text fields in the table:
- one for the link text
- one for the display text.

Use the AfterUpdate event of the [link text] to assign the same value to the
[display text]. The use can then change it to something else if they wish.

On your form, you can provide a 3rd text box bound to:
=IIf([link text] Is Null, Null, [display text] & "#" & [link text] &
"#")
This will be a clickable hyperlink (assuming you set the text box
properties), but they use the other 2 text boxes to actually edit the link
and display text.

It seems to me that this is the correctly normalized approach (i.e. stuffing
2 things into the one field is not normalized.)
 
C

Chegu Tom

Thanks Allen. I needed that too

Tom the lurker.


Allen Browne said:
Can I suggest storing this information as 2 text fields in the table:
- one for the link text
- one for the display text.

Use the AfterUpdate event of the [link text] to assign the same value to
the [display text]. The use can then change it to something else if they
wish.

On your form, you can provide a 3rd text box bound to:
=IIf([link text] Is Null, Null, [display text] & "#" & [link text] &
"#")
This will be a clickable hyperlink (assuming you set the text box
properties), but they use the other 2 text boxes to actually edit the link
and display text.

It seems to me that this is the correctly normalized approach (i.e.
stuffing 2 things into the one field is not normalized.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

osupratt via AccessMonster.com said:
I have a table where I would like to store hyperlink information. This
table
is a linked table to sql server. There is no hyperlink datatype in sql
server.
So I have a field VARCHAR named sqlHyperlink. Of course I can't change
this to data type hyperlink in Access because it is linked. Is there
anyone
who would know how I can set a text box up on a form with a browse button
to look for the user to search for a file and once selected store this
'link'
information in the text field?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top