File name from full path

MikeAngelastro

Registered User.
Local time
Today, 06:09
Joined
Mar 3, 2000
Messages
254
Hi,

This is not a question.

Today I discovered a very valuable function. This function will take ANY full path - I don't care how many subdirectories are involved - and in one fell swoop will give you the file name. The function is one of the functions supplied by VBA. It is extremely useful when you use the common dialog for retrieving files. I did a lot of searching on this and did not find it referred to at all in the Access help facility. No more need of Left, Len, InStr, etc. to find filenames. All you need to do is use the Dir function.

Dir(FullPath) gives you the file name in the path - the functionality is just like it is for the DOS command line.

I hope many of you find this useful. For those of you who are already aware of this function, I hope I didn't waste too much of your time. For me, this was a great find.

So if all you want is the file name within a path, use the Dir function.

Mike
 

Users who are viewing this thread

Back
Top Bottom