J
JimS
Transaction table has ONE key field...Autonumber called TransID. No other
fields are marked as "No duplicates". I'm inserting some transactions from a
linked spreadsheet. Has worked exactly as written before. SQL looks like this:
INSERT INTO tblTransactions ( PartNbr, TransNbr, LineNbr, Qty,
TransactionType, UserID, SessionID, TransactionDateTime )
SELECT qryNewPOs.strPartNbr, qryNewPOs.[PO No], qryNewPOs.[PO Line],
qryNewPOs.Qty, "P" AS Blah1, "Auto" AS Blah2, "Auto" & Now() AS Blah3, Now()
AS Blah4
FROM qryNewPOs;
Note, no reference to TransID, as this is an autonumber field (Access 2003
with FE/BE...all tables are linked to a backend .mdb)
When I run the query, I get a key violation on all inserted records.
Where do I look for an answer? I tried manually adding a record to the trans
table. It worked, and the TransID field incremented by three or four
(probably due to multiple times I ran the above query and failed....) Still
no joy. I deleted the record I added manually. Still no joy.
I think the engine has lost track of the autonumber sequence. How can I
reset it?
fields are marked as "No duplicates". I'm inserting some transactions from a
linked spreadsheet. Has worked exactly as written before. SQL looks like this:
INSERT INTO tblTransactions ( PartNbr, TransNbr, LineNbr, Qty,
TransactionType, UserID, SessionID, TransactionDateTime )
SELECT qryNewPOs.strPartNbr, qryNewPOs.[PO No], qryNewPOs.[PO Line],
qryNewPOs.Qty, "P" AS Blah1, "Auto" AS Blah2, "Auto" & Now() AS Blah3, Now()
AS Blah4
FROM qryNewPOs;
Note, no reference to TransID, as this is an autonumber field (Access 2003
with FE/BE...all tables are linked to a backend .mdb)
When I run the query, I get a key violation on all inserted records.
Where do I look for an answer? I tried manually adding a record to the trans
table. It worked, and the TransID field incremented by three or four
(probably due to multiple times I ran the above query and failed....) Still
no joy. I deleted the record I added manually. Still no joy.
I think the engine has lost track of the autonumber sequence. How can I
reset it?