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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Hyperlinks

Status
Not open for further replies.

lazydays

Technical User
Sep 29, 2003
93
0
0
GB
I have a form which uses 4 unbound text boxes to add information to a table.
I use the following code.

DoCmd.RunSQL "INSERT INTO tblPasswords(UserPlace, UserName, Password, Website) VALUES(txtAddReason, txtUserName, txtPassword, txtWebsite);"
DoCmd.Requery


However, I would like the last unbound text box (txtWebsite) to save to tblPasswords.Website as a hyperlink - at the moment it doesn't! Is there a way to do this?

Thanks!
 
Hi,
Change the Field "website" datatype to "Hyperlink" in the table design.
then whate ever data entered to it will act as hyperlink. If it is a broken link then an error message will be produced.
Regards


Zameer Abdulla
 
The table field is set up as a hyperlink - in the form, the mouse arrow changes to a finger to suggest it is a hyperlink, but nothing happens when you click on it!

Hope that makes sense!
 
I have checked that and the textbox is set to
Is Hyperlink = Yes

That still isn't working...
 
Hi,
I don't know what else can be the reason. You say there are no messages also appearing!!

try any of the following or all
1) do a compact & repair database
2) create a new form
3) create a new table or delete the field and create a new one
regards

Zameer Abdulla
 
I have had the same problem that hyperlinks don't work when clicked on. I don't know why but using this little peace of code it started to work:

Code:
Function openfile()

    Dim fso As Object
    Set fso = CreateObject("Scripting.FileSystemObject")


    If Not IsNull(Forms![Searchresults]![Search subform]![Link:]) Then
        If (fso.FileExists(Forms![Searchresults]![Search subform]![Link:])) Then
        Application.FollowHyperlink Forms![Searchresults]![Search subform]![Link:], , True
        End If
    End If
    Exit Function
    
End Function

On the onclick event of the textbox call the function with this: =openfile()

It works for me on hyperlinks to documents, but I would guess it works as well on links to webpages.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top