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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can access change the name of a textfile

Status
Not open for further replies.

ghayman73

Technical User
Jul 3, 2002
55
FR
is it possible to change the name of a textfile via access as i am transfering a table to a text file to incriment by 1 each time.

eg textfile01
next textfile02 etc.

or

can it be changed with acces once it has been created.

thanks in advance

Grant
 
Grant

Use

Name path-to-oldfile As newname

eg

Name "C:\My Documents\Fred.Doc" As "C:\My Documents\Jim.doc"

John

 
sorry john not sure what you mean?

will that change the file name or will it overwrite the old file with the new one and change it.

this is the problem i have:

i have a table with around 11000 records that ia am trying to split up into text files each with 100 records in (the records only hold one field)

I have set up a macro to transfer a table that i create from the main table with the top 100 names in it.

the problem is that i have to manualy change the textfile to another name before running the macro again.

is there a way to automate this so it names the text file with an icrimented number.

the macro then updates the 100 records and calls the next hundred to be tranfered.

i may be going about this the wrong way so any help would be appreciated.

grant
 
Grant

The "Name" function will rename an existing file on disk. It has the same effect as right clicking on the file in Explorer, choosing Rename and entering the new name.

I am not quite sure exactly what it is you want and need a little clarification before I can help more.
Do you want a system that will just return incremented filenames which you can then feed into your macros, or an automated system to export batches of 100 records from a table out to separate text files? I understand that with 11000 records you would require 110 text files, which is quite a lot of changes to the macro, so I can see why you want it.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top