Really annoying error with Microsoft Office Access

Asked By 0 points N/A Posted on -
qa-featured

 

Hi,

 Access provides a number of error messages, but many are confusing to the users. I find it sometimes useful to replace the system error messages with custom error messages. The Null primary key is a case in point.

When I try to leave a record on a form without a primary key value, the form will display the following error message. I am very upset how to resolve this issue? Help me to resolve this problem. Thanks.

Error Message: Index or primary key cannot contain a null value.

SHARE
Answered By 0 points N/A #184358

Really annoying error with Microsoft Office Access

qa-featured

Hi Michael,
The error is because two or more primary keys are declared on different tables, stored in the MS Access.
Solution 1:
If your form control is a Text Box, you need to add a default value to it. It can generate a null string value, if proper input is not supplied to it.
Solution 2:
If your form control is a Combo box,try using UNION to set a special value, instead of representing NULL.

Login/Register to Answer

Related Questions