Discussion Locked

VB6/Access97 - RecordSet.Update

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am receiving a runtime error (3314) when saving a new record to an Access 97 DB: "The field "Titles.ISBN" cant contain a null value because the required property for this field is set to true".
The ISBN field is the PK of the Titles table and a FK in the AuthorISBN table.
The relationship between the tables is 1(Titles) to many(AuthorISBN).
Both recordsets have been .AddNew and the error occurs at the .Update for the recordsets, when i select cmdSave.

5 replies

by xxx123

If a field is part of your primary key then in cannot contain nulls, period. You are trying to add a row but haven't populated that field or have moved a variable containing a null value into that field.

If you don't have any data to put in that field, you can enter a blank space (as in " ") or a value like "unknown".

by dsa

Try setting the "Allow Zero Length" to YES in the table design for the field that is giving the error.

This discussion is closed to new replies.