By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

How do I create a hyperlink button on a form?

P: 25
I'm trying to create a hyperlink button on a form that does the following:

1. User clicks on button
2. The default 'insert hyperlink' window appears
3. User selects the desired file
4. User clicks ok
5. Path of the file comes in the textbox

A button is needed for each textbox that requires a hyperlink. Is this possible? (Note: I'm a beginner with no programming experience and this is my first database.)
Oct 11 '07 #1
Share this Question
Share on Google+
5 Replies


P: 76
I found this code to work great for what I needed. First you need to create a button then point it to this code.

Private Sub browse_Click()

Me.[Hyperlink].SetFocus
On Error GoTo browse_stop
RunCommand acCmdInsertHyperlink
browse_stop:

End Sub

This works exactly how you explained you needed.
Oct 11 '07 #2

P: 25
I tried the code and got this error:

Run-time error '2465':

System can't find the field 'I' referred to in your expression.

How can I fix this?
Oct 11 '07 #3

P: 76
I'm sorry, in the code:

Private Sub browse_Click()

Me.[your_location].SetFocus
On Error GoTo browse_stop
RunCommand acCmdInsertHyperlink
browse_stop:

End Sub

In your_location, put where you want the link to show up at. My location was called "Hyperlink".
Oct 11 '07 #4

P: 25
Exactly what I wanted. Thanks man.You have no idea how much you've helped me with your posts.
Oct 11 '07 #5

P: 76
No problem, I get help I try to help.
Oct 11 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.