looping thru a url

B

Bill Betournay

Hi all

I'm trying to find the list functions in VBA but I'm coming up empty handed.
Hopefully someone here can point me in ht eright direction.

I have a URL. e.g.: \\sharedinfo\labOne\commonDocs\safetyProceedures.doc

I'm in need of a way of grabbing just the file name and extention from the
directory path. In my report I want to be able to display
safetyProceedures.doc in a label but use the whole path for the link. I
cound add anoth firld to the DB table for just the file name but I already
have in stored here so I'd like to use this rather then create another
field.

In another language I use regularily there is a LISTLAST function. I'm
hoping for the same or similar. LISTLAST(MyDirectoryVar, "\")

Thank in advanced

Bill
 
M

Mark A. Sam

Hello Bill,

This will parse the file name from the CurrentDB.name value.

Right(CurrentDb.Name,Len(Currentdb.Name)-InStrRev(CurrentDb.Name, "\"))

so you might try
Right(CurrentDb.Name,Len(MyDirectoryVar)-InStrRev(MyDirectoryVar, "\"))

or some variation to get it to work for you.

God Bless,

Mark A. Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top