'Installment #2, completes #1 to 100%
oIns.DueDate = Installment #2 Date
oIns.Percentage = Percentage
lRetCode = oInv.Add ' Try to add the invoice to the database
If lRetCode <> 0 Then
oCompany.GetLastError(lErrCode, sErrMsg)
MsgBox(lErrCode & " " & sErrMsg) ' Display error message
Else
MsgBox("Invoice Added to DataBase", MsgBoxStyle.Information, "Invoice Added")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub