Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Code to Delete a File

Status
Not open for further replies.

bhujanga

Programmer
Oct 18, 2007
181
US
In my records I have a field that is a file name. This particular table comes up in a subform as a list, so that any of the photos in the list can be opened. I have a button next to each record that allows the user to delete that photo from the, so all the button does currently is to delete the record. I want to give the user the option to delete the photo file if they wish, but I can't figure out the code to use. I found this syntax:

object.DeleteFile filespec

but I can't figure out what to put in for 'object'.

Thanks.
 
Object in this case would be the FileSystemObject Object. You may also wish to look at Kill.
 
Kill" is just what I needed - much simpler than the other way. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top