为什么我继续收到此问题运行时“ 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_发票查询”
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')
任何想法可能是什么问题?