how to use a field value in hyperlink?

G

Guest

I am building a from that has a text box, and a button. When the button is
clicked, I am wanting it to take the value from the text box, and insert it
into the URL.

I saw some examples, but I am unable to get it to work.

Example:

1. Bridge ID NO: 12345
2. Click the button and it takes you to:
\\Videosrv\Bridge\BridgeMaintVault\b12345\plans

Can someone please help?!
 
J

JethroUK©

if the hyperlink is a field value - you dont need a button - just set the
field 'type' to 'hyperlink'
 
E

enginerd477

Mike:

I had the same problem and used this code someone gave to me:

Private Sub Open_Report_Click()
On Error GoTo Err_Open_Report_Click

Dim filename As String
filename = "\\averill\public$\Engineering\Part_Database\" &
CStr(Me!Report) & ".doc"
Application.FollowHyperlink filename

EXit_Open_Report_Click:
Exit Sub

Err_Open_Report_Click:
MsgBox "There are no files with this Report Number"
Resume EXit_Open_Report_Click

End Sub

Change the file string to whatever the path is that you need to follow
and then Change "Report" to the Control variable on your form and
change ".doc" to the correct file type you want to open.

Good luck and let me know if you need help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top