Link to home
Create AccountLog in
Avatar of frank_guess
frank_guessFlag for United States of America

asked on

Runtime Error 3256 Item not found in collection

I have a program that is supposed to pull information from a table and split into multiple parts.
'******************************************************************************************************
Private Sub Command14_Click()

    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Dim rsDev1 As DAO.Recordset
    Dim rsDev2 As DAO.Recordset
    Dim rsDev3 As DAO.Recordset
    Dim rsDev4 As DAO.Recordset
    Dim rsDev5 As DAO.Recordset
    Dim subEmplNo As String
   
    Set db = CurrentDb
        CurrentDb.Execute "DELETE * FROM Tbl_Dev1" 'delete all the Records and start clean
        CurrentDb.Execute "DELETE * FROM Tbl_Dev2" 'delete all the Records and start clean
        CurrentDb.Execute "DELETE * FROM Tbl_Dev3" 'delete all the Records and start clean
        CurrentDb.Execute "DELETE * FROM Tbl_Dev4" 'delete all the Records and start clean
        CurrentDb.Execute "DELETE * FROM Tbl_Dev5" 'delete all the Records and start clean
    Dim EachParagraph() As String                                ' string
    Dim EachFieldInLine() As String                              ' string
    Dim I As Integer
    Dim J As Integer
    Dim K As Integer
    Dim L As Integer
    Dim AddDev4 As Boolean
    AddDev4 = False
     Set rs = db.OpenRecordset("tblTemp")
     Set rsDev1 = db.OpenRecordset("Tbl_Dev1")
     Set rsDev2 = db.OpenRecordset("Tbl_Dev2")
     Set rsDev3 = db.OpenRecordset("Tbl_Dev3")
     Set rsDev4 = db.OpenRecordset("Tbl_Dev4")
     Set rsDev5 = db.OpenRecordset("Tbl_Dev5")
    ' At this point the entire text File is in the Array
    ' Search for #, or Names  Privliges,Institutions, Parameters and Machines
rs.MoveFirst

Do Until rs.EOF
'******************************************************************************************************
     If InStr(1, rs!fldtextin, "Password ", vbTextCompare) Then
    GoTo rsdev1Line                                                  ' we have employee Number Line
    Else: GoTo ChkrsLineDesc
    End If
rsdev1Line:
    EachFieldInLine() = Split(rs!fldtextin, "  ", , vbTextCompare)
    subEmplNo = EachFieldInLine(0)                                    'Check if we have emploeee in DB
     
      If IsNull(DLookup("[fldEmp_No_Dev1]", "tbl_Dev1", "[fldEmp_No_Dev1] = " & """" & EachFieldInLine(0) & """")) Then
       rsDev1.AddNew
       rsDev1!fldEmp_No_Dev1 = subEmplNo
       rsDev1.Update
      End If
    rsDev1.Index = "PrimaryKey"
    rsDev1.Seek "=", subEmplNo
    rsDev1.Edit
    rsDev1!fldPassword = funTweenText(rs!fldtextin, "(days): ", " Status")
    rsDev1!fldStatus = funTweenText(rs!fldtextin, "Status: ", " ")
    rsDev1.Update
    rs.MoveNext
ChkrsLineDesc:
    If Left(rs!fldtextin, 12) = "Description:" Then
        rsDev1.Seek "=", subEmplNo
        rsDev1.Edit
        rsDev1!fldName = funTweenText(rs!fldtextin, "Description:", "Last Logon:")
        If Len(funTweenText(rs!fldtextin, "Description:", "Last Logon:")) < 2 Then
              rsDev1!fldName = "  "
        Else
              rsDev1!fldName = funTweenText(rs!fldtextin, "Description:", "Last Logon:")
        End If
        If Len(funTweenText(rs!fldtextin, "Last Logon:", "Langauge")) < 2 Then
            rsDev1!fldLastLogon = "  "
        Else
            rsDev1!fldLastLogon = funTweenText(rs!fldtextin, "Last Logon:", "Langauge")
        End If
        rsDev1.Update
        rs.MoveNext
     End If
    ' Nothing with  Default Configuration:
   
'************************************ 2nd Procedure = Priviliges: ******************************************************
Chkrsdev2Line:
    If Left(rs!fldtextin, 11) <> "Priviliges:" Then GoTo Chkrsdev3Line
    rs.MoveNext   ' drop line that says Priviliges:
rsdev2Line:
   
       'Loop through add to DEV2 Table till see "Institutions:"
      'COF Import Destination
       EachFieldInLine() = Split(Trim(rs!fldtextin), "  ", , vbTextCompare)
       If UBound(EachFieldInLine) < 0 Then GoTo GetNext3line
        rsDev2.AddNew
        rsDev2!fldEmp_No_Dev2 = subEmplNo
        rsDev2!Fld_Prv1_Dev2 = EachFieldInLine(0)
            rs.MoveNext   ' added  Next 3 lines
    If rs.EOF Then
     GoTo modskipEdit
    End If
    If InStr(1, rs!fldtextin, "Institutions:", vbTextCompare) Then GoTo Chkrsdev3Line
     If InStr(1, rs!fldtextin, "COF Import Destination", vbTextCompare) Then GoTo Chkrsdev4Line
    ' NOT REALLY  sinc it would be part of prev line
          If Left(rs!fldtextin, 13) = "Institutions:" Then
             GoTo Chkrsdev2Line
          End If
       EachFieldInLine() = Split(Trim(rs!fldtextin), "  ", , vbTextCompare)
        ' see if next line is 1 - new add   or >1 items then add to current line
        For L = LBound(EachFieldInLine) To UBound(EachFieldInLine)
         If EachFieldInLine(L) = "Institutions:" Then
         rsDev2.Update
         GoTo Chkrsdev3Line
         End If
         If EachFieldInLine(L) = "COF Import Destination" Then
         rsDev2.Update
         GoTo Chkrsdev4Line
         End If

        rsDev2.Fields("Fld_Prv" & L + 2 & "_Dev2") = EachFieldInLine(L)
       
        Next L
        rsDev2.Update

     ' NEEDS CODE IF Privelidge is IN table  HOw to remove?
     ' build an array and do a reverse check to run through Table
     ' and if not in array then delete record
GetNext2line:
    rs.MoveNext
    If rs.EOF Then
       
    GoTo modskipEdit
    End If
   
   
    If InStr(1, rs!fldtextin, "Institutions:", vbTextCompare) Then GoTo Chkrsdev3Line
     If InStr(1, rs!fldtextin, "COF Import Destination", vbTextCompare) Then GoTo Chkrsdev4Line
    ' NOT REALLY  sinc it would be part of prev line
          If Left(rs!fldtextin, 11) = "Institutions:" Then
        GoTo Chkrsdev4Line
      End If
    GoTo rsdev2Line
'************************************* 3rd Procedure *****************************************************************
Chkrsdev3Line:
    If Left(rs!fldtextin, 13) <> "Institutions:" Then GoTo Chkrsdev5Line
    rs.MoveNext   ' drop line that says institutions
rsdev3Line:
      'Loop through add to DEV3 Table till see "Synovus 2005 Parms"
      'COF Import Destination
       EachFieldInLine() = Split(Trim(rs!fldtextin), "  ", , vbTextCompare)
       If UBound(EachFieldInLine) < 0 Then GoTo GetNext3line
        rsDev3.AddNew
        rsDev3!fldEmp_No_Dev3 = subEmplNo
        rsDev3!Fld_Prv1_Dev3 = EachFieldInLine(0)
            rs.MoveNext   ' added  Next 9 lines
    If rs.EOF Then
     GoTo modskipEdit
    End If
    If InStr(1, rs!fldtextin, "Synovus 2005 Parms", vbTextCompare) Then GoTo Chkrsdev4Line
     If InStr(1, rs!fldtextin, "COF Import Destination", vbTextCompare) Then GoTo Chkrsdev4Line
    ' NOT REALLY  sinc it would be part of prev line
          If Left(rs!fldtextin, 9) = "Machines:" Then
        GoTo Chkrsdev5Line
      End If
       
       
       
        EachFieldInLine() = Split(Trim(rs!fldtextin), "  ", , vbTextCompare)
        ' see if next line is 1 - new add   or >1 items then add to current line
        For L = LBound(EachFieldInLine) To UBound(EachFieldInLine)
         If EachFieldInLine(L) = "Synovus 2005 Parms" Then
         rsDev3.Update
         GoTo Chkrsdev4Line
         End If
         If EachFieldInLine(L) = "COF Import Destination" Then
         rsDev3.Update
         GoTo Chkrsdev4Line
         End If

        rsDev3.Fields("Fld_Prv" & L + 2 & "_Dev3") = EachFieldInLine(L)
       
        Next L
        rsDev3.Update

     ' NEEDS CODE IF Privelidge is IN table  HOw to remove?
     ' build an array and do a reverse check to run through Table
     ' and if not in array then delete record
GetNext3line:
    rs.MoveNext
    If rs.EOF Then
       
    GoTo modskipEdit
    End If
   
   
    If InStr(1, rs!fldtextin, "Synovus 2005 Parms", vbTextCompare) Then GoTo Chkrsdev4Line
     If InStr(1, rs!fldtextin, "COF Import Destination", vbTextCompare) Then GoTo Chkrsdev4Line
    ' NOT REALLY  sinc it would be part of prev line
          If Left(rs!fldtextin, 9) = "Machines:" Then
        GoTo Chkrsdev5Line
      End If
    GoTo rsdev3Line
'****************************************** 4th Procedure = ************************************************************
Chkrsdev4Line:

        rsDev4.AddNew
        rsDev4!fldEmp_No_Dev4 = subEmplNo
        ' Added next 3 lines    actually change first  added next 2
        rsDev4!Fld_Prv1_Dev4 = "  "
        If InStr(1, rs!fldtextin, "Synovus 2005 Parms", vbTextCompare) Then rsDev4!Fld_Prv1_Dev4 = "Synovus 2005 Parms"
     If InStr(1, rs!fldtextin, "COF Import Destination", vbTextCompare) Then rsDev4!Fld_Prv1_Dev4 = "COF Import Destination"
        rsDev4.Update
       rs.MoveNext
      If Left(rs!fldtextin, 9) = "Machines:" Then   'Added these three lines
        GoTo Chkrsdev5Line
      End If
Continue4Line:
        rsDev4.AddNew
        rsDev4!fldEmp_No_Dev4 = subEmplNo
       rsDev4!Fld_Prv1_Dev4 = rs!fldtextin
        rsDev4.Update
       rs.MoveNext
      If Left(rs!fldtextin, 9) = "Machines:" Then
        GoTo Chkrsdev5Line
      End If


'**************************************** 5th Procedure = **************************************************************
Chkrsdev5Line:

If Left(rs!fldtextin, 9) <> "Machines:" Then
      GoTo MoveNextRsLine
      End If
      rs.MoveNext ' Skip line that has Machines:

      EachFieldInLine() = Split(Trim(rs!fldtextin), "  ", , vbTextCompare)

       If Len(EachFieldInLine(0)) < 3 Then GoTo GetNext5line
       For L = 0 To UBound(EachFieldInLine)


        rsDev5.AddNew
        rsDev5!fldEmp_No_Dev5 = subEmplNo
        rsDev5!Fld_Prv1_Dev5 = EachFieldInLine(L)
        'rsDev5.Update

     Next L
     ' NEEDS CODE IF Institution is IN table  HOw to remove?
     ' build an array and do a reverse check to run through Table
     ' and if not in array then delete record


GetNext5line:
    rs.MoveNext
    If rs.EOF Then
    GoTo modskipEdit
    End If
    If InStr(1, rs!fldtextin, "Password ", vbTextCompare) Then

      GoTo modskipEdit   ' replaced this 1
     
    Else
    End If
MoveNextRsLine:
rs.MoveNext
modskipEdit:
 Loop

                 
    rsDev1.Close
    rsDev2.Close
    rsDev3.Close
    rsDev4.Close
    rsDev5.Close

    Set rsDev1 = Nothing
    Set rsDev2 = Nothing
    Set rsDev3 = Nothing
    Set rsDev4 = Nothing
    Set rsDev5 = Nothing
                   
    Set db = Nothing
'---------------

    DoCmd.Hourglass False
     
Exit_Command14_Click:
    Exit Sub

Err_Command14_Click:
    MsgBox Err.Description & "+" & Err.Number
    Resume Exit_Command14_Click

End Sub

Private Sub Command4_Click()
On Error GoTo Err_Command4_Click


    DoCmd.Close

Exit_Command4_Click:
    Exit Sub

Err_Command4_Click:
    MsgBox Err.Description
    Resume Exit_Command4_Click
   
End Sub

Private Sub Command5_Click()
'Set Variables for Document Name

    Dim filebox As OPENFILENAME  ' open file dialog structure
    Dim fname As String          ' filename the user selected
    Dim result As Long           ' result of opening the dialog
    Dim SaveAsName As String       ' file to save in the dialog
    Dim ExtName As String
    Dim boolAutoNum As Boolean
    Dim EachParagraph() As String

    Dim db As DAO.Database
    Dim rs As DAO.Recordset
 
    Set db = CurrentDb

        CurrentDb.Execute "DELETE * FROM TblTemp" 'delete all the Records and start clean
DoCmd.Hourglass True
 
'---------
'Get document Name
    ' Configure how the dialog box will look
    With filebox
        ' Size of the structure.
        .lStructSize = Len(filebox)
        ' Handle to window opening the dialog.
            .hwndOwner = Me.hwnd
        ' Handle to calling instance (not needed).
        .hInstance = 0
        ' File filters to make available: Text Files and All Files
        .lpstrFilter = "All Files (*.txt)" & vbNullChar & "*.txt" & vbNullChar & vbNullChar
       
        .nMaxCustomFilter = 0
        ' Default filter is the first one (Text Files, in this case).
        .nFilterIndex = 1
        ' No default filename.  Also make room for received
        ' path and filename of the user's selection.
        .lpstrFile = Space(256) & vbNullChar
        .nMaxFile = Len(.lpstrFile)
        ' Make room for filename of the user's selection.
        .lpstrFileTitle = Space(256) & vbNullChar
        .nMaxFileTitle = Len(.lpstrFileTitle)
        ' Initial directory is C:\.
        .lpstrInitialDir = "C:\" & vbNullChar
        ' Title of file dialog.
        .lpstrTitle = "Select the Proposal Document to be searched" & vbNullChar
        ' The path and file must exist; hide the read-only box.
        .flags = OFN_PATHMUSTEXIST Or OFN_FILEMUSTEXIST Or OFN_HIDEREADONLY
        ' The rest of the options aren't needed.
        .nFileOffset = 0
        .nFileExtension = 0
        '.lpstrDefExt is ignored -- unused string
        .lCustData = 0
        .lpfnHook = 0
        '.lpTemplateName is ignored -- unused string
    End With

    ' Display the dialog box.
    result = GetOpenFileName(filebox)
   
    If result <> 0 Then
        ' Remove null space from the file name.
        fname = Left(filebox.lpstrFile, InStr(filebox.lpstrFile, vbNullChar) - 1)
        ExtName = Right(fname, 4)
        fnameext = ExtName
        'Debug.Print "The selected file: "; fname
    End If

'------
'Read the txt file in a varible
   
    Dim InputData As String

    Open fname For Input As #1
        InputData = Input(LOF(1), #1)
    Close #1
'------
'save the Paragraphs as a Record
   

     Set rs = db.OpenRecordset("TblTemp")

    EachParagraph = Split(InputData, vbCrLf)
    ' At this point the entire text File is in the Array
    ' Search for #, or Names  Privliges,Institutions, Parameters and Machines
    For I = LBound(EachParagraph) To UBound(EachParagraph)
    'EachParagraph(I) = Replace(EachParagraph(I), ":", ",")
    'Replace multiple occurances of tab characters to nothing
    ' In second part 3 spaces is determination for different text
    Do Until InStr(EachParagraph(I), Chr(9)) = 0
    EachParagraph(I) = Replace(EachParagraph(I), Chr(9), "     ")
    'if InStr(EachParagraph(I), "  ") = 0
    Loop
    'EachParagraph(I) = Replace(EachParagraph(I), ":", ",")
    'Replace multiple occurances of spaces to 3 spaces
    ' In second part 3 spaces is determination for different text
    Do Until InStr(EachParagraph(I), "   ") = 0
    EachParagraph(I) = Replace(EachParagraph(I), "   ", "  ")
    'if InStr(EachParagraph(I), "  ") = 0
    Loop
SkipLine:
    EachParagraph(I) = Trim(EachParagraph(I))  ' remove leading/trailing spaces

    EachFieldInLine = Split(EachParagraph(I), "  ", , vbTextCompare)
    ' ImageVision User Security Report
    'Check if we have emploeee in DB
    If InStr(1, EachParagraph(I), "Print Date", vbTextCompare) Then GoTo JumptoNextI
    If InStr(1, EachParagraph(I), "ImageVision User", vbTextCompare) Then GoTo JumptoNextI
   
      If Len(EachParagraph(I)) > 4 Then
       rs.AddNew
       rs!fldtextin = EachParagraph(I)
       rs.Update
      End If
JumptoNextI:        ' rsDev1.Move
Next I


                 
    rs.Close

    Set rs = Nothing
                   
    Set db = Nothing
'******************************************************************************************************
DoCmd.Hourglass False
 
     
Exit_Command5_Click:
    Exit Sub

Err_Command5_Click:
    MsgBox Err.Description & "+" & Err.Number
    Resume Exit_Command5_Click
 
 
End Sub







Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Where is this error occurring? What line?
Avatar of frank_guess

ASKER

The runtime error is hitting the line below which is part of the 2nd Procedure

        rsDev2.Fields("Fld_Prv" & L + 2 & "_Dev2") = EachFieldInLine(L)

I am stumped.  If I set <> the
          If Left(rs!fldtextin, 13) = "Institutions:" Then
             GoTo Chkrsdev2Line
          End If
So it reads
          If Left(rs!fldtextin, 13) <> "Institutions:" Then
             GoTo Chkrsdev2Line
          End If
the error goes away but I only have one read through the file for pulling the information I need and placing into 4 separate fields in a table.  

************************************ 2nd Procedure = Priviliges: ********
Chkrsdev2Line:
    If Left(rs!fldtextin, 11) <> "Priviliges:" Then GoTo Chkrsdev3Line
    rs.MoveNext   ' drop line that says Priviliges:
rsdev2Line:
   
       'Loop through add to DEV2 Table till see "Institutions:"
      'COF Import Destination
       EachFieldInLine() = Split(Trim(rs!fldtextin), "  ", , vbTextCompare)
       If UBound(EachFieldInLine) < 0 Then GoTo GetNext3line
        rsDev2.AddNew
        rsDev2!fldEmp_No_Dev2 = subEmplNo
        rsDev2!Fld_Prv1_Dev2 = EachFieldInLine(0)
            rs.MoveNext   ' added  Next 3 lines
    If rs.EOF Then
     GoTo modskipEdit
    End If
    If InStr(1, rs!fldtextin, "Institutions:", vbTextCompare) Then GoTo Chkrsdev3Line
     If InStr(1, rs!fldtextin, "COF Import Destination", vbTextCompare) Then GoTo Chkrsdev4Line
    ' NOT REALLY  sinc it would be part of prev line
          If Left(rs!fldtextin, 13) = "Institutions:" Then
             GoTo Chkrsdev2Line
          End If
       EachFieldInLine() = Split(Trim(rs!fldtextin), "  ", , vbTextCompare)
        ' see if next line is 1 - new add   or >1 items then add to current line
        For L = LBound(EachFieldInLine) To UBound(EachFieldInLine)
         If EachFieldInLine(L) = "Institutions:" Then
         rsDev2.Update
         GoTo Chkrsdev3Line
         End If
         If EachFieldInLine(L) = "COF Import Destination" Then
         rsDev2.Update
         GoTo Chkrsdev4Line
         End If

        rsDev2.Fields("Fld_Prv" & L + 2 & "_Dev2") = EachFieldInLine(L)
       
        Next L
        rsDev2.Update

     ' NEEDS CODE IF Privelidge is IN table  HOw to remove?
     ' build an array and do a reverse check to run through Table
     ' and if not in array then delete record
GetNext2line:
    rs.MoveNext
    If rs.EOF Then
       
    GoTo modskipEdit
    End If
   
   
    If InStr(1, rs!fldtextin, "Institutions:", vbTextCompare) Then GoTo Chkrsdev3Line
     If InStr(1, rs!fldtextin, "COF Import Destination", vbTextCompare) Then GoTo Chkrsdev4Line
    ' NOT REALLY  sinc it would be part of prev line
          If Left(rs!fldtextin, 11) = "Institutions:" Then
        GoTo Chkrsdev4Line
      End If
    GoTo rsdev2Line
So this line errors:

rsDev2.Fields("Fld_Prv" & L + 2 & "_Dev2") = EachFieldInLine(L)

If so, are you SURE that a field exists for whatever is returned by the ("Fld_Prv" & L + 2 & "_Dev2" equation? In other words, if you set a breakpoint on that line, then type THIS in the immediate window:

?rsDev2.Fields("Fld_Prv" & L + 2 & "_Dev2")

and press Enter, does the error recur? If so, then basically your code is telling you that the field doesn't exist. If no error occurs, then I'd suspect that you have a problem in the EAchFieldInLine routine, whatever that may be.

And I'd STRONGLY urge you to get rid of the GoTo syntax ... this is nearly impossible to trouble shoot and is considered very poor programming. You're much better off to break out those code blocks into separate Function or Sub calls and loop through your data correctly.



I have a table with five fields
fldEmp_No_Dev2, Fld_Prv1_Dev2, Fld_Prv2_Dev2, Fld_Prv3_Dev2, Fld_Prv4_Dev2
A fellow programmer hope me with this program and I need some guidance as how to write this program better.  An example would help to replace the go to statements to get me on the right track.
You might try something like this:

rsDev2.Fields("Fld_Prv" & Cstr(L + 2) & "_Dev2")

Did you try the Immediate window? REgardless of what your table structure would be, the Immediate window would tell you whether the code can find that particular field.

I have no idea what this code does (nor would I even attempt to figure it out), but it appears that you are looping through a recordset and doing something. In the first instance, instead of the If xxx Then GoTo SomeLable Else GoTo AntoherLabel, we just move everything from the SomeLabel to the first section of the If, then move everything from the AnotherLable to the second section of the If (the Else section).

If InStr(1, rs!fldtextin, "Password ", vbTextCompare) Then
    '/GoTo rsdev1Line                                                  ' we have employee Number Line
    '/instead of doing GoTo, we're moving everything from the rsdev1line to this If - End If block
 EachFieldInLine() = Split(rs!fldtextin, "  ", , vbTextCompare)
    subEmplNo = EachFieldInLine(0)                                    'Check if we have emploeee in DB
     
      If IsNull(DLookup("[fldEmp_No_Dev1]", "tbl_Dev1", "[fldEmp_No_Dev1] = " & """" & EachFieldInLine(0) & """")) Then
       rsDev1.AddNew
       rsDev1!fldEmp_No_Dev1 = subEmplNo
       rsDev1.Update
      End If
    rsDev1.Index = "PrimaryKey"
    rsDev1.Seek "=", subEmplNo
    rsDev1.Edit
    rsDev1!fldPassword = funTweenText(rs!fldtextin, "(days): ", " Status")
    rsDev1!fldStatus = funTweenText(rs!fldtextin, "Status: ", " ")
    rsDev1.Update
    rs.MoveNext
   
Else
  '/: GoTo ChkrsLineDesc
  '/instead of this GoTo, we're moving everything from chkrslinedesc to this section
    If Left(rs!fldtextin, 12) = "Description:" Then
        rsDev1.Seek "=", subEmplNo
        rsDev1.Edit
        rsDev1!fldName = funTweenText(rs!fldtextin, "Description:", "Last Logon:")
        If Len(funTweenText(rs!fldtextin, "Description:", "Last Logon:")) < 2 Then
              rsDev1!fldName = "  "
        Else
              rsDev1!fldName = funTweenText(rs!fldtextin, "Description:", "Last Logon:")
        End If
        If Len(funTweenText(rs!fldtextin, "Last Logon:", "Langauge")) < 2 Then
            rsDev1!fldLastLogon = "  "
        Else
            rsDev1!fldLastLogon = funTweenText(rs!fldtextin, "Last Logon:", "Langauge")
        End If
        rsDev1.Update
        rs.MoveNext
     End If
End If

While this was a great example for what I need to change at a later time this however does not get me with the fix to the code I need.
I have a series of tables that this program is supposed to file in.  the program takes from the primary table which is
TblTemp where there is a field is named fldTextIn
This feeds 5 tables information from this fldTextIn field
Table one is for extracting the Employee number into FldEmp_No_Dev1
2nd field is stripping more information fldPassword
3rd field is stripping more information FldStatus
4th field is name of person
5th field is last log in fldlastlogon
6th field is language in fldLanguage
Table 2 is the access codes the employee is setup with
fldEmp_No_Dev2 = Employee number
Fld_Prv1_Dev2
Fld_Prv2_Dev2
Fld_Prv3_Dev2
Fld_Prv4_Dev2
These fields would hold the following information
Employee number
ADMIN
SORTEROP
DATAEDIT
BALANCE
QUERY
REPORTS
STATEMENT bANKCFG
and so on  This could go on for several rows and must be separated from each group.  The item that separates the user information from this group of information is where it sets between a line with Priviliges:
and a line Institutions:
This goes on throughout the entire file.  This is key to what I must do with it later.
 
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Returns an error asking for Fields, I set it = EachFieldInLine(L)
and it would work as long as I used <> for
 If EachFieldInLine(L) <> "Institutions:" Then

But it only gives me one read through the file.  I need the read to go through the entire file multiple times to gather all values and place them into separate fields between "Priviliges:"
and "Institutions:"
Found the problem.  The number2 was causing the code to return the runtime error.  Once I changed it to a 1 it worked like a champ.