The Student Room Group

MS:-SQL on Access

I have this query that appends Orders Pending and am not sure how it is to work but it wont work. Although it says there is 1 record to append

This message appears:
MS set 0 field(s) to null type conversion & didn’t add 1 record(s) to table due key violations, 0 records due lock violations & 0 records due to validation rule violations

this is the SQL statement:
INSERT INTO tblOrder ( InvoiceNo, ItemRef, ProductID, DateOfOrder, Width, Length )
SELECT tblOrder.InvoiceNo, tblOrder.ItemRef, tblOrder.ProductID, tblOrder.DateOfOrder, tblOrder.Width, tblOrder.Length
FROM (tblOrder INNER JOIN tblProduct ON tblOrder.ProductID = tblProduct.ProductID) INNER JOIN tblOnOrder ON tblProduct.ProductID = tblOnOrder.ProductID;

I read online that i need one field that has Yes - from the OnOrder(tbl)- Stock
Order(tbl) - Process, Awaiting Stock, Stock, Stock Received. In the Product(tbl)

its just really hard to understand and i cannot identify the main source for the problem
Reply 1
can someone please help me cause i am getting nowhere with this
Reply 2
"didn’t add 1 record(s) to table due key violations" - dont try to put data into autonumber fields, and make sure that its unique if its a primary/compound key.
Reply 3
thanks man very much
Reply 4
it still didnt work after i changed autonumber of ProductID in tblProduct. I need this thing workin but dont understand why it wont work :frown:
Reply 5
help me please

Latest

Trending

Trending