Query Link

kitty77

Registered User.
Local time
Today, 13:04
Joined
May 27, 2019
Messages
715
I have a field called [Link] and the data looks like this...
\customers\tomsmith\pdf\1234.pdf

In a query, how can I create a field that removes everything up to the pdf?
\customers\tomsmith\pdf

Thanks
 
You could use InStrRev() to look for the position of the last "\" and then use Left() up to that position.
 
Can you show me how that code would look in the query?
 
Can you show me how that code would look in the query?
Maybe something like
Code:
Expr1: Left([FieldName], InStrRev([FieldName], "\")-1)
(untested)
Hope that helps...
 
Works Great! One question though... The field [Link] is a hyperlink but when I use this code, it does not keep any hyperlink.
 
How about?
Code:
FolderLink: "#" & Left([FieldName], InStrRev([FieldName], "\")-1)
Hope that helps...

PS. If you're displaying this on a form, you might have to set the IsHyperlink property to Yes.
 

Users who are viewing this thread

Back
Top Bottom