Public Sub ImportIW(strFile As String)
' ***************************************************
' * Open a Text File And Loop Through It *
' ***************************************************
Dim intFile As Integer
Dim StrIn As String
Dim TheSOL_ID As String
Dim TheUser_ID As String
Dim TheLoanAcctNo As String
Dim TheDebitAcctNo As String
Dim TheAcceptedDate As String
Dim TheAmount As String
Dim TheStartChqNo As String
Dim TheBankName As String
Dim ThePresentationDate As String
Dim TheChqLodgedNo As String
Dim TheSetNo As String
Dim TempArray() As String
Dim FileType As String
Dim StartRead As Boolean
intFile = FreeFile()
Open strFile For Input As #intFile
Do While Not EOF(intFile)
Line Input #intFile, StrIn
If InStr(StrIn, "SOL ID") > 0 Then
'Debug.Print strIn
TheSOL_ID = FindAfter(StrIn, ":")
Debug.Print TheSOL_ID
ElseIf InStr(StrIn, "USER ID") > 0 Then
TheUser_ID = FindAfter(StrIn, ":")
StartRead = True
' Debug.Print TheUser_ID
ElseIf StrIn = "" Then
StartRead = False
ElseIf StartRead Then
TempArray = GetCleanArray(StrIn)
If UBound(TempArray) = 8 Then
If IsNumeric(TempArray(0)) Then
TheLoanAcctNo = TempArray(0)
TheDebitAcctNo = TempArray(1)
TheAcceptedDate = TempArray(2)
TheAmount = TempArray(3)
TheStartChqNo = TempArray(4)
TheBankName = TempArray(5)
ThePresentationDate = TempArray(6)
TheChqLodgedNo = TempArray(7)
TheSetNo = TempArray(8)
Debug.Print TheLoanAcctNo
' Debug.Print TheDebitAcctNo
' Debug.Print TheAcceptedDate
' Debug.Print TheAmount
' Debug.Print TheStartChqNo
' Debug.Print TheBankName
' Debug.Print ThePresentationDate
' Debug.Print TheChqLodgedNo
' Debug.Print TheSetNo
InsertIW TheSOL_ID, TheUser_ID, TheLoanAcctNo, TheDebitAcctNo, TheAcceptedDate, TheAmount, TheStartChqNo, TheBankName, ThePresentationDate, TheChqLodgedNo, TheSetNo
End If
End If
End If
Loop
Close #intFile
End Sub