Why do I keep receiving the issue Run-time "3155"
ODBC -- insert on a linked table 'New_Invoice' failed. At least one line record is required.
Is there an issue with my InvoiceLine Query?
The following is my code:
I have a button that executes these two queries:
First the QB_InvoiceLine Query:
INSERT INTO InvoiceLine ( InvoiceLineItemRefListID, InvoiceLineDesc, InvoiceLineQuantity, ClassRefListID, FQSaveToCache )
SELECT t.QB_RMA_Parts.ListID, t.Description, t.Quantity, t.Class_ID, 1
FROM ForQB AS t
WHERE (((t.RMA)=[Forms]![SendToQuickBooks]![enterRMA]));
Than the QB_Invoice Query:
INSERT INTO New_Invoice ( CustomerRefListID, ARAccountRefListID, TxnDate, IsPending, DueDate, PONumber, IsToBePrinted )
SELECT t.Customer.ListID, '8000001E-1478562986', Date(), 0, Date() + 30, 'None', 0
FROM ForQB AS t
InvoiceLine and New_Invoice are both linked tables to QuickBooks.
Perhaps it is my syntax?
I know it is not an issue with the linked tables as I've tried using the following, with no issues:
INSERT INTO InvoiceLine (InvoiceLineItemRefListID, InvoiceLineDesc, InvoiceLineRate, InvoiceLineAmount, InvoiceLineSalesTaxCodeRefListID, FQSaveToCache) VALUES ('800011C0-1483210384', 'Building permit 1', 1.00000, 1.00, '80000001-1478562826', 1)
INSERT INTO Invoice (CustomerRefListID, ARAccountRefListID, TxnDate, RefNumber, BillAddressAddr1, BillAddressAddr2, BillAddressCity, BillAddressState, BillAddressPostalCode, BillAddressCountry, IsPending, TermsRefListID, DueDate, ShipDate, ItemSalesTaxRefListID, Memo, IsToBePrinted, CustomerSalesTaxCodeRefListID) VALUES ('800001F4-1482536279', '8000001E-1478562986', #9/23/2020#, '1', 'Brad Lamb', '1921 Appleseed Lane', 'Bayshore', 'CA', '94326', 'USA', 0, '80000020-1526673448', #10/31/2020#, #10/01/2020#, '800028FF-1539628499', 'Memo Test', 0, '80000003-1482379268')
Any ideas what the problem could be?