extract from a field in Access

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Back
Top