By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

Need to delete the text file at time of import.

P: 6
Hi All,

I have a text file that i import from a location on my PC

eg: C:\MyTextfile.txt

I import this textfile into access using VBA. I am able to do this. What i need to add on to this is that, when i import i need to delete the file automatically from the location. ie i need to delete C:\MyTextfile.txt automatically at the time of import

Any thoughts on this is highly appreciated

-vvasude2
Feb 28 '12 #1

✓ answered by TheSmileyCoder

You simply need to add:
Expand|Select|Wrap|Line Numbers
  1. Kill "C:\MyTextFile.Txt"
Should you need to keep the file for audit purposes, you can use FileCopy to copy the file somewhere else first.

Share this Question
Share on Google+
3 Replies


TheSmileyCoder
Expert Mod 100+
P: 2,321
You simply need to add:
Expand|Select|Wrap|Line Numbers
  1. Kill "C:\MyTextFile.Txt"
Should you need to keep the file for audit purposes, you can use FileCopy to copy the file somewhere else first.
Feb 28 '12 #2

ADezii
Expert 5K+
P: 8,599
Expand|Select|Wrap|Line Numbers
  1. Kill "C:\My Textfile.txt"
Oops, sorry Smiley!
Feb 28 '12 #3

P: 6
Thanks both of you! worked
Feb 28 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.