473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Need to delete the text file at time of import.

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.

3 1155
TheSmileyCoder
2,322 Expert Mod 2GB
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
8,834 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. Kill "C:\My Textfile.txt"
Oops, sorry Smiley!
Feb 28 '12 #3
Thanks both of you! worked
Feb 28 '12 #4

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

Similar topics

1
by: Chris | last post by:
Background: I am using a MS Access 2000 front end with SQL Server 8.0 back end. I have the requirement to import all text files (regardless of filename) from a given folder on the network into a...
0
by: Newman | last post by:
Hello all I need help with a script. What I want to do is to select data from a sql database and then create a text file of that data. For example 'elect * from customers where code = misc' ...
3
by: Joe | last post by:
Hi, I have written a webpage that allows a user to delete files in asp.net with I am having a small problem. To access this page a user has to login via login.aspx page. After successful...
11
by: Tark Siala | last post by:
hi i'm working on VB.NET 203 and i'm working on application that read Metadata from Photo Take it from Digital Camera. i'm use this code: Dim imageX = New Bitmap(PhotoFullFileNameX) Dim...
2
by: al jones | last post by:
I'm trying to get something to work here and not having much luck. I can take the sledgehammer approach (read each line, parse for the tab sepertor, put each part in it's respective element) but...
0
by: CSharpguy | last post by:
I have a web form that has 22 text boxes on it were the user can enter in data, then click a button that needs to create a text file. I can create the text file fine, but how can I create a text...
2
by: Pipex News Group | last post by:
I Have a text file that I want to delete using the On Click event of a forms button, the text file is along the following path: C:\1.txt I have managed to create the text file from Access...
6
by: 000dreamsound000 | last post by:
Hi I need help with to access a text file over my local network. I need to be able to create,read, write and delete the txt file on a specific machine(s) from any computer over the network. The...
1
by: mbatestblrock | last post by:
so here is my first post http://www.thescripts.com/forum/thread711882.html everything was working just fine for me and I though I had it down, however the way this file is laid out doesnt...
2
by: TG | last post by:
Hi! I am trying to export only the visible columns from a datagridview in my windows form in VB 2008. Should't it be no comma after the first row where the headers are? Also should...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.