What's the right datatype for a URL (website) field?

T

Three Lefts

In a database to keep track of online purchases, I will have a Vendors
table. One of the fields will contain the URL for the vendor's website
(eg, www.amazon.com). Should I make this a text field or something
else?
 
D

Dale Fye

Personally, I like to store this as text, as the hyperlink datatype adds
some garbage to the actual value you enter. Unfortunately, when you do it
this way, you have to add some code to your application to actually follow
the hyperlink. I usually put code similar to the following in the
DoubleClick of the textbox, or in the Click event of a command button right
next to the value. You can even set the controls IsHyperlink property to
True, to get it to set the text to blue and underlined. You still need the
code, though. I usually use the DoubleClick event because if you just move
your mouse over the field and click into it, the hyperlink fires

If Len(Me.Text0 & "") > 0 Then
Application.FollowHyperlink Me.Text0, , True, False
End If

HTH
Dale
 
Top