Cannot Update Recordset

A

Anne

The following code in Access 97 will not work unless I remove the
relationships from the table (the recordset being updated). I've even tried
doing an update query instead, same results.

With rst6
.AddNew
rst6([strCtl15]).Value = ContractNumber
rst6(strCtl16).Value = strCYCode
rst6(strCtl17).Value = strValue
rst6(strCtl18).Value = strAmount
.Update
End With

Is this normal Access behavior? I'm more than a little uncomfortable
forgoing referential integrity......
 
T

Tim Ferguson

Is this normal Access behavior? I'm more than a little uncomfortable
forgoing referential integrity......

It's normal if the strCYCode doesn't exist in the foreign table...

Tim F
 
J

John Spencer

HARD to fully diagnose without knowing more about your table structure.

It sounds as if you are trying to populate a field in rst6 that is in a
relationship with another table.

That other table does not yet have the value you are trying to use. OR

You are NOT setting a value for the value in rst6 that is required for the
relationship between rst6 and the other table.
 
T

Tim Ferguson

But it is in the table...... it's the key field.

Not the field, the value!

If you try to put a value of "Blue" or 2305 into a foreign key field, then
you have to have a record in the other table *already there* with same
value in its PK field. That's what RI means.

I realise that I am guessing here, since you haven't actually told us what
the error message is...

Hope it helps


Tim F
 
Top