Hi,
I need the Self balancing coded added to the make ABA file in V7
The output gave you the extra line below (second from the bottom)
0 01BWA KENLOW (1982) PTY LTD 173918Jiwa 0000000110515
1015-209493311287 500002760925ZIPTRACK PTY LTD Kenlow 306-068 4974883KENLOW 00000000
1306-068 4974883T130002760925KENLOW (1982) PTY LTD ZIPTRAK PAYMENT 306-068 4974883KENLOW (1982) PT00000000
7306-068 000000000000027609250002760925 000002
Original V6 Breakout below.
Make ABA File
'-------------
Const ForReading = 1, ForWriting = 2
Dim FileName
Dim fso, f
Dim TextOut
Dim lCreditor
Dim RecordCount
Dim TotalDebits
Dim TotalCredits
Dim DirectEntryUserID
DirectEntryUserID = "173918"
FileName = "j:\aba bankwest\" & ChequePaymentObject.BatchNo & ".ABA"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateTextFile(FileName, True)
TextOut = "0" _
& Space(17) _
& "01" _
& Left(ChequePaymentObject.BankEFTCode & Space(3), 3) _
& Space(7) _
& Left(ChequePaymentObject.BankAccountName & Space(26), 26) _
& Right("000000" & DirectEntryUserID, 6) _
& Left("Jiwa " & ChequePaymentObject.BatchNo & Space(12), 12)
TextOut = TextOut & Right("00" & Mid(ChequePaymentObject.Database.FormatDate(ChequePaymentObject.DateRun),13,2),2) _
& Right("00" & Mid(ChequePaymentObject.Database.FormatDate(ChequePaymentObject.DateRun),10,2),2) _
& Right("00" & Mid(ChequePaymentObject.Database.FormatDate(ChequePaymentObject.DateRun),7,2),2)
TextOut = TextOut & Space(40)
f.WriteLine TextOut
RecordCount = 0
For Each lCreditor In ChequePaymentObject.Creditors
If lCreditor.ChequeAmount <> 0 Then
RecordCount = RecordCount + 1
TotalCredits = TotalCredits + lCreditor.ChequeAmount
TextOut = "1" _
& Left(lCreditor.BankAccountBSBN & Space(7), 7) _
& Right(Space(9) & lCreditor.BankAccountNo, 9) _
& " " _
& "50" _
& Right("0000000000" & Trim(Replace(CStr(FormatNumber(lCreditor.ChequeAmount, 2,,,0)),".","")),10) _
& Left(lCreditor.BankAccountName & Space(32), 32) _
& Left(lCreditor.CreditorAltAccNo & Space(18), 18) _
& Left(ChequePaymentObject.BankAccountBSBN & Space(7), 7) _
& Right(Space(9) & ChequePaymentObject.BankAccountNumber, 9) _
& Left("KENLOW" & Space(16), 16) _
& "00000000"
f.WriteLine TextOut
End If
Next
RecordCount = RecordCount + 1
TotalDebits = TotalCredits
TextOut = "1" _
& Left(ChequePaymentObject.BankAccountBSBN & Space(7), 7) _
& Right(Space(9) & ChequePaymentObject.BankAccountNumber, 9) _
& Left("T", 1) _
& "13" _
& Right("0000000000" & Trim(Replace(CStr(FormatNumber(TotalDebits, 2,,,0)),".","")), 10) _
& Left(ChequePaymentObject.BankAccountName & Space(32), 32) _
& Left("Creditors Payments" & Space(18), 18) _
& Left(ChequePaymentObject.BankAccountBSBN & Space(7), 7) _
& Right(Space(9) & ChequePaymentObject.BankAccountNumber, 9) _
& Left(ChequePaymentObject.BankAccountName & Space(16), 16) _
& "00000000"
f.WriteLine TextOut
TextOut = "7" _
& Left(ChequePaymentObject.BankAccountBSBN & Space(7), 7) _
& Space(12) _
& Right("0000000000" & Trim(Replace(CStr(FormatNumber(TotalCredits - TotalDebits,2,,0)),".","")), 10) _
& Right("0000000000" & Trim(Replace(CStr(FormatNumber(TotalCredits, 2,,,0)),".","")), 10) _
& Right("0000000000" & Trim(Replace(CStr(FormatNumber(TotalDebits, 2,,,0)),".","")), 10) _
& Space(24) _
& Right("000000" & RecordCount, 6) _
& Space(40)
f.WriteLine TextOut
f.Close
MsgBox FileName & " Created."
End Sub