Hi All,

I'm trying to disply the last part of a hyperlink using the expression builder in access 2010 textbox.

eg.
#\\abc.org.uk\Root\OurSrevice\OurTeam\Peter\Dump\MyDoc.doc#
#\\abc.org.uk\OurSrevice\Team2\Folder2\YetAnotherFlder\Dump\View\MyOtherDoc.doc#

In the first example I want to display MyDoc.doc
In the second example I want to display MyOtherDoc.doc

I suspect I'll need to use the RIGHT and INSTR functions but dont know where to begin.

Any help would be appreciated

Recommended Answers

All 2 Replies

This should work:
=Mid(Left("#\\abc.org.uk\Root\OurSrevice\OurTeam\Peter\Dump\MyDoc.doc#",Len("#\\abc.org.uk\Root\OurSrevice\OurTeam\Peter\Dump\MyDoc.doc#")-1),InStrRev(Left("#\\abc.org.uk\Root\OurSrevice\OurTeam\Peter\Dump\MyDoc.doc#",Len("#\\abc.org.uk\Root\OurSrevice\OurTeam\Peter\Dump\MyDoc.doc#")-1),"\")+1)

1. find out he position of last "\" from right side.
2. add 1 to that value (+ 1)
3. find out the string from this position till the end of the string.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.