need textbox to show only portion of a field

D

deb

I have a field(Attchmt) that hold the location of a file...see bellow as an
example of data.

\\Dept34\ServiceProjects\Schedules\ProjectQuality.doc

Using the data from the field(Attchmt)
How can I display in a form(f020Attachments) textbox(AttchmtName) only the
document name? ProjectQuality.doc

Thanks in advance
 
K

KARL DEWEY

You should be able to use this ---
Expr1: Right([field(Attchmt)],InStrRev([field(Attchmt)],"\"))

But I had to use this ---
Expr1:
Right([field(Attchmt)],Len([field(Attchmt)])-InStrRev([field(Attchmt)],"\"))
 
F

fredg

I have a field(Attchmt) that hold the location of a file...see bellow as an
example of data.

\\Dept34\ServiceProjects\Schedules\ProjectQuality.doc

Using the data from the field(Attchmt)
How can I display in a form(f020Attachments) textbox(AttchmtName) only the
document name? ProjectQuality.doc

Thanks in advance

In an unbound text control on the form:

=Mid([Attchmt],InStrRev([Attchmt],"\")+1)
 
J

John W. Vinson

I have a field(Attchmt) that hold the location of a file...see bellow as an
example of data.

\\Dept34\ServiceProjects\Schedules\ProjectQuality.doc

Using the data from the field(Attchmt)
How can I display in a form(f020Attachments) textbox(AttchmtName) only the
document name? ProjectQuality.doc

Thanks in advance

With Access 2002 or later, set the Control Source of the textbox to

Mid([attchmt], InStrRev([attchmt], "\") + 1)

John W. Vinson [MVP]
 
Top