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

Create a Blank Text File using access

Status
Not open for further replies.

Seandirby

Technical User
Mar 17, 2006
2
US
Hey all,

This is a simeple question for something that will save me about an hour a day at work. I need to create a blank text file in several different locations at random intervals throughout the day. I've got a form with 8 buttons that needs to create a blank text file called "Confirm.txt" in a series of specific folders so that the other databases that run will pick up on the confirm.txt and kick off the reports for each client folder. The problem is I dont know how to create a blank text file using access. Your help is much appreciated.

Basically it's a button that creates a file to a directory once clicked.

Thank you.

Sdirby
 
Perhaps:
[tt]Open "confirm.txt" For Output As #1
Close #1[/tt]
 
I had to something like that, but I had to differentiate between the files. So, if you had to make a distinction between each Confirm.txt you could do something like this. I created a generic file that was blank. That is SourceFile below. Then I copied it with a new name. I placed the persons ID number on the file. Then I copied some info into the new one, but I left that code off. I placed the code on a command button from a form that supplied the person's ID. This way I could just keep creating copies in a quick manner.

Dim SourceFile, DestinationFile
Dim stDocName As String
SourceFile = "C:\Insurance_Client.mdb"
DestinationFile = "C:\Insurance_" & Forms![Contractor_Transfer_form]![holdpolicy] & ".mdb"
FileCopy SourceFile, DestinationFile

Just a thought
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top