PC Review


Reply
Thread Tools Rate Thread

deleting a external file from access 2007

 
 
OD
Guest
Posts: n/a
 
      23rd Jan 2010
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

 
Reply With Quote
 
 
 
 
Dale Fye
Guest
Posts: n/a
 
      24th Jan 2010
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
>



 
Reply With Quote
 
OD
Guest
Posts: n/a
 
      24th Jan 2010
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
> >

>
>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Access 2007 Marilyn Myers Microsoft Access External Data 2 3rd Jun 2010 07:21 PM
Export from MS Access 2007 to Quickbooks IIF - How can I create a tabdelimited text file from Access 2007? Steve Microsoft Access Macros 2 11th Nov 2009 01:52 PM
Buggy SQL Syntax for External File Path in Access 2007 Sky Microsoft Access VBA Modules 8 19th Mar 2009 08:16 PM
Access 2007: external txt data Gasperix Microsoft Access External Data 1 28th Jul 2008 03:44 PM
MS ACCESS 2007 deleting MS ACCESS 2003 forms and reports jsuckow@Austin.rr.com Microsoft Access Getting Started 1 14th May 2007 07:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:15 PM.