Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bank Entry record creation error

Status
Not open for further replies.

Bluejay07

Programmer
Mar 9, 2007
780
CA
Hello,

I'm using Accpac 5.5 and trying to create a bank entry.
I've used a macro as a basis although I am getting the following error:
Bank code has a different value than the header does.

Here is some of my code.
Code:
baDBLink.OpenView "BK0001", BKACCT
baDBLink.OpenView "BK0007", BKENT
   
BKACCT.Compose Array(Nothing, Nothing, Nothing, Nothing, BKENT, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
BKENT.Compose Array(BKACCT, Nothing, Nothing, Nothing)

BKENT.Browse "(RECONCILED = FALSE)", 1
BKACCT.Fetch
         
With BKENT
   .RecordClear
   .RecordCreate 0
        
   .Fields("POSTNOW").value = 1      '// 1 = yes.
   .Fields("BANK").value = l_strBankCode      '// Bank Code.
   .Fields("DATE").value = DateSerial(Year(Date), Month(Date), Day(Date))
         
   If l_dblTotalAmount < 0 Then l_dblTotalAmount = l_dblTotalAmount * -1
   .Fields("AMTDR").value = l_dblTotalAmount                        ' Debit Amount
         
   .Fields("GLACCOUNT").value = l_strAcctArray(i)                      ' G/L Account
   .Fields("REFERENCE").PutWithoutVerification (DateSerial(Year(Date), Month(Date), Day(Date)))   ' Reference
   .Fields("COMMENT").PutWithoutVerification ("Rapid Import")   ' Description
'   .Fields("BIGCOMMENT").PutWithoutVerification ("test comm")   ' Comments
         
'    .Fields("RECYEAR").value = 2013
'    .Fields("RECPERIOD").value = 5
         
     .Insert   [red]<------ ERROR[/red]
         
     .Fields("UNIQUE").PutWithoutVerification ("-1")          ' Entry Uniquifier
         
     .Read
     .Update
End With

I did come across thread631-1552567. It's similar but different.
Any suggestions would be greatly appreciated.

Thanks.

If at first you don't succeed, then sky diving wasn't meant for you!
 
Following the solution posted by JoeAtWork in the previously mentioned thread, I added the following:
Code:
BKACCT.Init
BKACCT.Cancel
BKACCT.Browse "BANK=""" & l_strBankCode & """", 1
If BKACCT.Fetch Then
   BKACCT.Read
End If

I am no longer getting the error (or any error), although the bank entry does not show up in a GL batch.
I'm still looking for assistance.

If at first you don't succeed, then sky diving wasn't meant for you!
 
Hi Tuba,

Thanks for the response.
The macro did have BK0101 values, however, I received errors as it got to .process.

After some discussions with my supervisor, my values are showing up when scrolling through the bank entries (it seems like I missed some code from the referenced thread) and he is fine leaving it at that.
This way the client can verify each entry for each bank before any further processes are applied.



If at first you don't succeed, then sky diving wasn't meant for you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top