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

Import text document with code

Status
Not open for further replies.
Aug 29, 2002
14
0
0
US
Want to have a stardard text file that is imported when a button within a form is clicked. I have the standard text file. It is CURRENT.TXT
Users will replace the current text file every couple of weeks and then hit a button to import the new data to an existing table.
(Old data has been deleted)

How can I do this with code?

Thanks for any help.
 
The following code is how you read a text file

Dim intInputLUN as Integer
Dim strRec as string

intInputLUN = FreeFile
Open "CURRENT.TXT" For Input As #intInputLUN

Do Until (EOF(intInputLUN))

Line Input #intInputLUN, strRec

Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top