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

extract filename text from hyperlink 1

Status
Not open for further replies.

swtrader

IS-IT--Management
Dec 23, 2004
182
US
I am using Access as a Document Manager -- saving most (but not ALL) documents in one folder. I drag the document into a hyperlink text field on a form. I would like to extract the name of the file to an adjacent unbound field.

Given these possibilities:

J:\AllDocuments\Bos_Birth_Certificate.pdf OR
L:\ABC Mfg\Repair History\Documents\ABC_Repair_Summary.xls


What is the syntax for extracting Bos_Birth_Certificate (and ABC_Repair_Summary) in either a column in a query or an unbound text box on a form?

Thank you.

SWTrader
 
A starting point:
Mid(Split(yourPathname, ".")(0), 1 + InStrRev(yourPathname, "\"))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
hmmm

ERROR MSG: The expression you entered has an invalid .(dot0 or ! operator or invalid parentheses.

This is what I have in the query...

JustTheFileName: Mid(Split([DocHyperLink],".")(0), 1 + InStrRev([DocHyperLink],"\"))
 
Sorry, you have to create an UDF (User Defined Function) in VBA to use the Split function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top