AddNew Method Problem

R

Retort

Hello,

I am receiving the following error during an ADO update to a table.
You cannot add or change a record because a related record is required in
table 'tblInventory'.
(Source: Microsoft JET Database Engine)
(SQL State: 3201)
(NativeError: -535037517)
(Connection State: 1)

The recordset supports both addnew and update (I verified using supports
method).

The table I am trying to add a record to is related to tblInventory by a
field with the same type and length and does indeed exist.

Any thoughts?

Thanks in advance,

Gary
 
J

John Vinson

Hello,

I am receiving the following error during an ADO update to a table.
You cannot add or change a record because a related record is required in
table 'tblInventory'.
(Source: Microsoft JET Database Engine)
(SQL State: 3201)
(NativeError: -535037517)
(Connection State: 1)

The recordset supports both addnew and update (I verified using supports
method).

The table I am trying to add a record to is related to tblInventory by a
field with the same type and length and does indeed exist.

The *FIELD* exists - but is there a record in tblInventory which
already contains the InventoryID (or whatever the linking field is)
value matching that which you are trying to add? What values are you
attempting to insert? Please post the code.

John W. Vinson[MVP]
 
J

JohnGriffiths

You are trying to add a stock item to your table without a row in table
tblInventry.

IE you cannot add a "Bannana Thrashing Machine" to a sales invoice if one
hasn't been set up in the Inventry.

HTH John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top