Skip to Content

LineNum Incorrect

Hi, Anyone know what is the error of this line num? I add a multiple lines and the lines number are not correct. Here is my code.

Dim LinesInvoice = oInvoice.Lines

i = 0

y = 0

Do

oInvoice.CardCode = TableLines.Rows(i).Item(12)

oInvoice.CardName = TableLines.Rows(i).Item(8)

oInvoice.DocDate = dtpDocDate.Text

oInvoice.DocDueDate = dtpDocDate.Text LinesInvoice.Add()

LinesInvoice.SetCurrentLine(y) LinesInvoice.ItemCode = TableLines.Rows(i).Item(11) LinesInvoice.ItemDescription = TableLines.Rows(i).Item(1)

LinesInvoice.Price = TableLines.Rows(i).Item(9)

LinesInvoice.Currency = TableLines.Rows(i).Item(10)

x = i

If x = TableLines.Rows.Count - 1

Then

RowCheck = ""

Else

x = x + 1

RowCheck = TableLines.Rows(x).Item(12)

End

If y += 1 If RowCheck <> TableLines.Rows(i).Item(12) Or RowCheck = ""

Then

lRetCode = oInvoice.Add

y = 0

If lRetCode <> 0 Then

oCompany.GetLastError(lErrCode, sErrMsg)

If (lErrCode <> -4006) Then

MsgBox(lErrCode & " " & sErrMsg)

End If

Else DocNum += 1

MsgBox("Invoice Added to DataBase - " & DocNum, MsgBoxStyle.Information, "Invoice Added")

End If

End If

i += 1

Loop Until i = TableLines.Rows.Count

line.png (4.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 02, 2017 at 02:01 AM

    Could anyone help me on this matter. Thank you.

    Add comment
    10|10000 characters needed characters exceeded