troubleshooting Question

Input past end of file

Avatar of kkapush
kkapush asked on
Microsoft Access
7 Comments1 Solution1379 ViewsLast Modified:
I am trying to read a .txt file and as I read it in line-by-line, pase the data and append it to the appropriate table either Guests Names, Show Information and Orders.  I keep receiving the error...

 Runtime Error '62'.
"Input Past End of File."

I tried using the EOF and Lof functions as Microsoft suggests and neither work.  Can anyone help.  

Here is my code...

Open MyLoc For Input As #1    ' Open file for input.
Do While MyLocation < LOF(1)  ' Loop until end of file.
    MyLocation = Loc(1)
    Input #1, ModeNum, CCName, CCType, CCNo, CCEXP, SUDef1
    Debug.Print ModeNum, CCName, CCType, CCNo, CCEXP, SUDef1    ' Print data to the Immediate window.
    MyLine = MyLine & Input(1, #1)

Loop
Close #1    ' Close file.


Here is the contents of the .txt file...

1,Paul P. Barnes,Mastercard,1111222233334444-555,01/05,11223344556677
2,Customer1,Unspecified,,,,,22222,joe
3,001,10,Glass Bottle
3,002,1,Tubes
2,Cust2,,,,,,11111,ken@aol.com
3,001,30,Glass Bottle
3,002,1,Tubes


Thanks,

Ken
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros