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

Storing Hyperlink in a table

Status
Not open for further replies.

Costefran

Technical User
Jan 2, 2008
197
GB
Can anyone help

I have some code on a form that allows the user to create a hyperlink to a document and places the file path in a label on the form

I would like to be able to store the hyperlink in a bound control so it is associated with the record

At the moment when then hyperlink is created it appears in every record

Is there anyway to convert the hyperlink to text so I can store it and then convert the text back to a hyperlink on the forms open event as I have tried using a text, memo and hyperlink control and none of these work

Any help would be appreciated

thanks
 
You need to store it in a TABLE.
Either create a new table or add a field to an existing table.


Randy
 
Thanks

Can you advise what data type I can store it as

I have tried memo, hyperlink and text but get an error message

Thanks
 
The "Hyperlink" address is just a "String" value and can be stored that way so a text field will work.

I'm not sure how you are trying to apply it.

So, say you want to assign the hyperlink address to a command button.

I created a simple table with a text field called Hyperlink and bound a textbox to that field. When my form opens I assign the address saved in the table to the textbox and on the form open event, assign that address to the command buttons hyperlink address.

Code:
Private Sub Form_Open(Cancel As Integer)
    txtHyperlink.SetFocus
    cmdHyperlink.HyperlinkAddress = Trim(txtHyperlink.Text)
End Sub

Worked on my end
 
Can anyone tell me what the code is for a command button that creates a hyperlink?
 
What's wrong with the code I posted above?

What have you tried / done since you first posted the question back in February?
 
I'm not the same user as the one that posted the question. I still have to create the button code from scratch.

What I want is a button that opens a file dialog where the user can point to a certain file. The hyperlink to the file is then to be inserted in the assigned field.
 
If you are using Access 2003 or above.

Reference the Microsoft Office 11.0 Object Library and follow this thread.

You will need to make some adjustments since this one fitlers for Excel files.

There are other threads on "File Dialogs" and using this method and others that use API calls.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top