Hyperlink or URL In Table and Forms (1 Viewer)

jms3257

Member
Local time
Today, 13:55
Joined
Apr 18, 2020
Messages
33
Not sure if this should be here in "Tables" or "Forms" but here goes. DB I'm creating will have quite a number of web addresses, and will be sorted by "Team Type" Sport Type" Gender Type" and "Level Type" (ie: Varsity, JV, Freshman) These will be in a table. Would I be better off storing as a hyperlink, or URL? Or does it matter one way or another? In the Main Form I will have command buttons to go to the different websites, if that matters in the choices.

Thank You
Jim:
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:55
Joined
Oct 29, 2018
Messages
21,467
Hi Jim. If it's just going to be URLs, my vote would be to store them as Plain Text.
 

Eljefegeneo

Still trying to learn
Local time
Today, 12:55
Joined
Jan 10, 2011
Messages
904
I am just a amateur at all the programming nuances, but I found early on that trying to edit email and web pages was exasperating, especially for the users who didn't understand why when they tried to edit either of these fields that they were ending up sending unwanted messages or going to unwanted we pages. So I always made them text fields and used the following for web pages or email:
Code:
'--Error Handling
On Error GoTo ErrorHandler
'WebPage is no longer a hyperlink, this code will bring up the web page
Dim WebLink As String
    If Me.WebPage Like "http://" & "*" Then
        WebLink = Me.WebPage
ElseIf Me.WebPage Like "https://" & "*" Then
    WebLink = Me.WebPage
Else
    WebLink = "http://" & Me.WebPage
End If
    'Debug.Print WebLink
        Application.FollowHyperlink WebLink, , True    
ErrorHandler:
If Err.Number = 87 Then
MsgBox "This Is Not A Valid WebLink"
End If
And
Code:
Dim olApp As Object
Dim mItem As Object
Set olApp = CreateObject("Outlook.Application")
Set mItem = olApp.CreateItem(0)  ' An Outlook Mail item
Dim DateE As String
Dim MsgR As String
' Add the To/Subject/Body to the message and display the message
With mItem
    .To = CStr(Me.Email)
    .Display    ' To show the email message to the user
End With
' Release all object variables
Set mItem = Nothing
    Set olApp = Nothing
And always used the double click to use them as only one click would be the same as if they were hyperlink fields.
 

Users who are viewing this thread

Top Bottom