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

opening txt files from a module 1

Status
Not open for further replies.

R9772

Technical User
Aug 15, 2002
76
US
can anyone help me in writing code to open a text file for processing in access. i am trying to make this happen automatically and can't seem to find a good example of how to do it.

 
Look in Help for Open Statement, Input Statement, Close Statement, etc...

Brief example:

Dim MyIndex, FileNumber
For MyIndex = 1 To 5 ' Loop 5 times.
FileNumber = FreeFile ' Get unused file number.
Open "TEST" & MyIndex For Output As #FileNumber 'Create filename.
Write #FileNumber, "This is a sample." ' Output text.
Close #FileNumber ' Close file.
Next MyIndex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top