Hi Scott,
you can do a reverse search for \
and then take the RIGHT characters from the string for the
filename
dim mPos as integer, mFilename as string
mPos = instrRev(FilePath_variable,"\")
mFilename = right(FilePath_variable,
len(FilePath_variable)-mPos)
Have an awesome day
Warm Regards,
Crystal
MVP Microsoft Access
strive4peace2006 at yahoo.com
> How can I get just the filename mypic1.jpg from below path? The path can
> change to other sub folders, so I'd like to get the text after the last "\".
>
> PATH
>
> C:\data\access\mypic1.jpg
Duane Hookom - 23 Feb 2006 06:09 GMT
Or
Dir(FilePath_Variable)

Signature
Duane Hookom
MS Access MVP
--
> Hi Scott,
>
[quoted text clipped - 21 lines]
>>
>> C:\data\access\mypic1.jpg
Crystal - 23 Feb 2006 07:53 GMT
Hi Duane,
You are so clever!
Have an awesome day
Warm Regards,
Crystal
MVP Microsoft Access
strive4peace2006 at yahoo.com
> Or
> Dir(FilePath_Variable)
Duane Hookom - 23 Feb 2006 15:40 GMT
Your solution is more robust since my solution requires the file to exist.
If there is no file of that spec, the Dir() won't return any value.

Signature
Duane Hookom
MS Access MVP
--
> Hi Duane,
>
[quoted text clipped - 10 lines]
>> Or
>> Dir(FilePath_Variable)
Crystal - 23 Feb 2006 16:56 GMT
Hi Duane,
Thanks ... did I just get a consolation prize ;)
Have an awesome day
Warm Regards,
Crystal
MVP Microsoft Access
strive4peace2006 at yahoo.com
> Your solution is more robust since my solution requires the file to exist.
> If there is no file of that spec, the Dir() won't return any value.
Duane Hookom - 23 Feb 2006 21:08 GMT
No, I think you get the Gold and I get the Silver since I took a short cut
that might lead to a tree or rock.

Signature
Duane Hookom
MS Access MVP
--
> Hi Duane,
>
[quoted text clipped - 11 lines]
>> exist. If there is no file of that spec, the Dir() won't return any
>> value.
Crystal - 24 Feb 2006 01:42 GMT
you are funny, Duane ;) and you must be a skiier too ;)
I am happy you posted that -- it is something else to think
about...
Have an awesome day
Warm Regards,
Crystal
MVP Microsoft Access
strive4peace2006 at yahoo.com
> No, I think you get the Gold and I get the Silver since I took a short cut
> that might lead to a tree or rock.
Scott - 24 Feb 2006 00:10 GMT
thx.
> Hi Scott,
>
[quoted text clipped - 21 lines]
>>
>> C:\data\access\mypic1.jpg
Crystal - 24 Feb 2006 01:43 GMT
you're welcome, Scott ;) happy to help
Have an awesome day
Warm Regards,
Crystal
MVP Microsoft Access
strive4peace2006 at yahoo.com
> thx.
>
[quoted text clipped - 23 lines]
>>>
>>>C:\data\access\mypic1.jpg