extract from a field in Access

G

Guest

Hi guys;

I need some help to extract from a field some data as follow:


C:\dir1\dir2\FILEX.DOC
I need only filex.doc

z:\dir1\dir2\dir3\dir4.....\dirx\FILEY.XLS
I need only filey.xls

d:\dir2\diru\dirq\dir\t\FILEX.LONG.NAME.TXT
I need only filex.long.name.txt

In other words i need the last piece of data after the last "\", these field
is used in a hyperlink field.
ps: i start with VB yesterday and i like it.

Can some one help me????

Mario
 
G

Guest

Try

Mid([FieldName],InstrRev([FieldName],"\")+1)

The InstrRev will return the position of the last \
And the Mid function will return the string from that point + 1
 
G

Guest

That Dit it!
Tks for your valuable help.
Mario

Ofer Cohen said:
Try

Mid([FieldName],InstrRev([FieldName],"\")+1)

The InstrRev will return the position of the last \
And the Mid function will return the string from that point + 1

--
Good Luck
BS"D


Mario said:
Hi guys;

I need some help to extract from a field some data as follow:


C:\dir1\dir2\FILEX.DOC
I need only filex.doc

z:\dir1\dir2\dir3\dir4.....\dirx\FILEY.XLS
I need only filey.xls

d:\dir2\diru\dirq\dir\t\FILEX.LONG.NAME.TXT
I need only filex.long.name.txt

In other words i need the last piece of data after the last "\", these field
is used in a hyperlink field.
ps: i start with VB yesterday and i like it.

Can some one help me????

Mario
 

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