Input past end of file - error 62 when trying to review a text file...

I'm having difficulty in overcoming a #62 error with the following code:  Please let me know what I'm doing wrong:
I get the error highlighted on line:  Input #1, sName, bAdjust, bLogOut, sDate, sUserName
When I review the text file:  I got the following one line item....
C:\WORK\010-DBtieaccess\dbtieaccess.mdb   -1             0            4/19/2006 7:14:41 PM        SLecompt

Public Function Check_Maintenance(sDBName As String) As Boolean
On Error GoTo Err_DoSomething

  Dim bLogOut As Boolean
  Dim sName As String
  Dim bAdjust As Boolean
  Dim sUserName As String
  Dim sDate As String
  Dim bFound As Boolean
  Dim lFile As Long
  lFile = FreeFile
  '@@@ add code here
  'to pull file first over to C:\ if connected to network only
  'and of course comparing DateFileTime modified date
  'then run it off your C:\ without affecting the network...
  Open tieFileSource & "\dbnames.list" For Input As #lFile
  Do While EOF(lFile) = False
    If EOF(lFile) = True Then
      Exit Do
    Else
      Input #1, sName, bAdjust, bLogOut, sDate, sUserName
      If sName = sDBName Then
        bFound = True
        Exit Do
      End If
    End If
  Loop
  Close #1

  If bFound = False Then bLogOut = False
  Check_Maintenance = bLogOut
 
Exit_Something:
  Exit Function
Err_DoSomething:
  Call Need_ErrorAction(Err, Err.Description, "zDBAssign @ Check_Maintenance", Erl())
  Resume Exit_Something
End Function
LVL 1
stephenlecomptejrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:


            Line Input #1, sName, bAdjust, bLogOut, sDate, sUserName
0
stephenlecomptejrAuthor Commented:
When I try the following - Line Input #1, sName, bAdjust, bLogOut, sDate, sUserName

I get a compile error:  syntax error with the highlight on the comma , after sName.
0
stephenlecomptejrAuthor Commented:
Also when I first have this file saved or appeneded - it is with the following:

Dim lFile As Long
lFile = FreeFile
Open tieFileSource & "\dbnames.list" For Append As #lFile
Print #1, CurrentDb.Name, -1, 0, Now(), Need_myUserName
Close #1
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Rey Obrero (Capricorn1)Commented:
oh sorry.

this codes will read the text file line by line

Dim lFile As Long, TextLine as string
lFile = FreeFile
Open tieFileSource & "\dbnames.list" For Input As #1
Line Input #1, TextLine  

<TextLine will contain the first line of your text file.>
Do While Not EOF(1)
'codes here
 
Loop
0
stephenlecomptejrAuthor Commented:
Oh okay -

having the VBA codingi this way:
Open tieFileSource & "\dbnames.list" For Input As #lFile
  Do While EOF(lFile) = False
    If EOF(lFile) = True Then
      Exit Do
    Else
     
      Input #lFile, sName, bAdjust, bLogOut, sDate, sUserName
      Debug.Print sName, bAdjust, bLogOut, sDate, sUserName
      If sName = sDBName Then
        bFound = True
        Exit Do
      End If
    End If
  Loop
  Close #lFile

it stops at :  Input #lFile, sName, bAdjust, bLogOut, sDate, sUserName and gives run-time error 62 input past end of file.

when I do a Print sName I get:
C:\WORK\010-DBtieaccess\dbtieaccess.mdb   -1             0            4/19/2006 7:14:41 PM        SLecompt

and all the other variables are blank...
so how I can make this grab each invidual line item and put in a variable?
I don't want it to be like:  

Open tieFileSource & "\dbnames.list" For Append As #lFile
Print #1, CurrentDb.Name
Print #1,  -1,
Print #1, 0
Print #1, Now()
Print #1, Need_myUserName
Close #1

I need it all on a single-line item.
0
Rey Obrero (Capricorn1)Commented:
<TextLine will contain the first line of your text file.>
s/b

<TextLine will contain the  line by line of your text file.>
so the first

Line Input #1, TextLine   ' will contain the first line  

the second

Line Input #1, TextLine   ' will contain the second  line   etc.,..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stephenlecomptejrAuthor Commented:
This also a matter of changing the Print statement syntax to something else:
Had to include " , " in the statement for the variables!

Print #1, Need_MyCPUName & " , " & Need_myUserName & " , 0, " & Now()

Thanks for trying to help me- cap!
Always!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.