AddNew Method Problem

  • Thread starter Thread starter Retort
  • Start date Start date
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
 
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]
 
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
 
Back
Top