"Mark" <ma**********@ntlworld.com> wrote in message
news:4Q***********@newsfe2-gui.ntli.net...
Hi all,
I use an application (auto FE updater) supplied by Tony to keep my
frontend up to date. I initially distributed the FE as a MDB but have
since changed it to an MDE. Does anyone have some code that I could use
which would look in a variable directory to see if this particular file
exists and if it does, delete it?
By variable directory, I mean the path would be along the lines of:
"C:\Documents and Settings\%username%\My Documents\database.mdb"
Thanks in advance for any suggestions,
Mark
You could use the function listed at
http://www.mvps.org/access/api/api0054.htm to get the 'My Documents' path
and hence get the full path of the database you need to delete. You can use
the Dir function to check it's there and then use Kill to delete the file.
Don't forget that it might be possible to calculate the path of the file to
be deleted from that of the application that's running the code - for
example by using CurrentDb.Name