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

Hyperlink Display Text

Status
Not open for further replies.

sianmace

Programmer
Jun 8, 2004
14
GB
I have a hyperlink column in a table
I would like to be able to enter a code in to the field, ex. T12345
and then when the hyperlink is clicked, it navigate to G:/Path/T12345.pdf

Now, i dont want to see G:/Path/T12345.pdf in the column.

I know that i can change the Display Text of the hyperlink by right clicking and editing, but i wish to do this all in VBA.

so i need to 1. handle the change from t12345 to Path & t123445 & extention
and then
2. change the display text back to T12345

Any Ideas???
 
Take a look at the HyperlinkPart method in the VBA help file and pay attention to the special meaning of #

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I have looked at what you suggested, and i have seen how to get the Display Text out once its set, but dont know how to set it without having to right click and edit the hyperlink
Please Help
 
I have it, sorry, i can see now.

Have you got any suggestions how to deal with this replacement i have to make then in code.

Users will Type T12345
I will replace with something like
T12345#G:/Path/T12345.pdf

but shall i capture this in the after update event, or before update. im getting a few errors when im trying this, saying its conflicting with saving?

what do you recon
 
I should stop and think for a min before posting

i used this

Private Sub URL_AfterUpdate()

If Len(URL.Text) > 0 Then
URL.Value = URL.Text & "#G:\Path\" & URL.Text & ".pdf"
End If

End Sub

The reason it was breaking was i was trying to set the Text value and not the Value!!!

Thanks a lot, much appriciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top