Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Box

Status
Not open for further replies.

Rseven

Technical User
Mar 7, 2006
41
US
Hello....I have a form that I am loading from importing an Excel spreadsheet to a table. One of the fields is setup as a hyperlink but when the field is populated on the form from the import the link does not work. However if you type the link in the text box, it does work. Any ideas on how I would get it to work when imported?

Thanks in advance!!
 
You will need to update the field once you have imported. A hyperlink field takes the format:

Name or address of site#
That is, the hyperlink itself is included between hashmarks - this part of the adress is not visible unless you choose to edit the field.

That being said, I have found hyperlinks to be annoying and difficult to maintain, so I prefer to use text fields with a little code:

Code:
Function DefaultEmail(EmailAddress)
'For email addresses 
    If Trim(EmailAddress) = "" Then
        CustomMessageBox "Please enter an email address."
    Else
        FollowHyperlink "MailTo:" & EmailAddress
    End If
End Function

Function GetURL(URL)
'For websites
    If Trim(URL & " ") = "" Then
        CustomMessageBox "Please enter a website address."
    Else
        If InStr(URL, "[URL unfurl="true"]http://")[/URL] = 0 Then
            URL = "[URL unfurl="true"]http://"[/URL] & URL
        End If
        FollowHyperlink URL
    End If
End Function

It would be simple enough to add code for opening local documents etc - Followhyperlink will work with any registered extension (.doc, .xls, .bmp, etc) and also with directories and so forth.

You can add the function to the Double Click event by typing on the line in the properties form:

[tt]=GetURL([NameOfTextboxHere].[Text])[/tt]



 
I will give it a shot, thanks!!
 
Worked like a charm, the only issue is that it opens minimized on the toolbar, is there anyway to have it open in maximized IE?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top