Hello,
I am trying to create a batch in AP. I have some code that works great in AR but trying something similar in AP gives me an error:
438; Object doesn't support this property or method.
Here is the code for AP:
I have tried several variations and constantly get the same error message. I have also tried recording a macro and still the same error.
Looking through the threads, I came across the following:
which ettienne replied with something similar to my macro.
Can anyone help me to overcome this problem?
Thanks.
I am trying to create a batch in AP. I have some code that works great in AR but trying something similar in AP gives me an error:
438; Object doesn't support this property or method.
Here is the code for AP:
Code:
Dim APBTA As AccpacCOMAPI.AccpacView
On Error GoTo ERR_Handler
cdDBLink.OpenView "AP0030", APBTA
With APBTA
.Fields("PAYMTYPE").PutWithoutVerification ("PY") '// Batch Selector.
.Fields("CNTBTCH").PutWithoutVerification ("0") '// Batch Number
.Init
.Fields("BATCHDESC").Value = GetSetting(REG_ROOT, "SAInfo", "APBatchDesc", "") & " " & FormatDateTime(Date, vbShortDate)
.Fields("DATEBTCH").Value = Date
.Fields("IDBANK").Value = GetSetting(REG_ROOT, "SAInfo", "APBankCode", "")
.Fields("BATCHTYPE").Value = 2 '// 2 = Imported.
.Update
End With
I have tried several variations and constantly get the same error message. I have also tried recording a macro and still the same error.
Looking through the threads, I came across the following:
which ettienne replied with something similar to my macro.
Can anyone help me to overcome this problem?
Thanks.