Thanks i found if you use
varFile = Application.HyperlinkPart([Document Location], acDisplayedValue)
it returns the string with out the extra chars.
I still have a problem if the file is in a sub directory of the current dir
it only returns relative path not the full path, if not then it returns the
full path.
Thanks Dale
Always more than one way to kill a kitty
"Dale Fye" wrote:
> OD,
>
> The problem with hyperlink fields is that they contain more than just the
> path and file name. Which is why I never use hyperlink fields. Instead I
> use a text field and use the double click event of the textbox associated
> with the field (or a command button) to actually jump to or open the
> hyperlink.
>
> If you convert the text of the hyperlink field using cStr([fieldname]), it
> adds a # to the front and back of the path/filename, so if you do something
> like:
>
> Kill Replace(cstr([Document Location]))
>
> it should work.
>
> Dale
>
> "OD" <(E-Mail Removed)> wrote in message
> news:C2FA8E9F-57E5-491F-87F5-(E-Mail Removed)...
> >I have a form that has a hyperlink field. When the user deletes a record I
> > need to delete the file that the hyperlink points to.
> >
> > When I store the hyperlink field info into a var I cannot get Kill to
> > delete
> > the file. If I type the full path manually kill works fine. I don't know
> > where the file will be stored so I need to get the full path. I tried to
> > use
> > fullpath, access did not like it.
> > EXAMPLE:
> > varMyString = [Document Location] Note: Hyperlink field
> > I don't know what I'm doing wrong.
> > Thanks
> > OD
> >
>
>
> .
>
|