为什么我不断收到问题Run-time "3155"
ODBC -- 在链接表“New_Invoice”上插入失败。至少需要一个行记录。
我的 InvoiceLine 查询有问题吗?
以下是我的代码:
我有一个执行这两个查询的按钮:
首先是 QB_InvoiceLine 查询:
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]));
比 QB_Invoice 查询:
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 和 New_Invoice 都是 QuickBooks 的链接表。
也许这是我的语法?
我知道这不是链接表的问题,因为我尝试使用以下内容,没有问题:
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')
任何想法可能是什么问题?