I am not sure how you are coding this, but I would check to see if the invoice number exists before even trying to enter it. I have written code in c#, but I would assume the libraries are similar for VB. Below is an example of how to query a table and check the results in c# //Search for document number Microsoft.Dexterity.Applications.Dynamics.Tables.PmPaidTransactionHist.Key = 3; Microsoft.Dexterity.Applications.Dynamics.Tables.PmPaidTransactionHist.DocumentNumber.Value = docNum; TableError err = Microsoft.Dexterity.Applications.Dynamics.Tables.PmPaidTransactionHist.Get(); if (err == TableError.NoError) { //Invoice exists } else { //Invoice does not exist } ~James
↧