Index or primary key cannot contain a Null value (Error 3058)

Index or primary key cannot contain a Null value (Error 3058)

Post by Allen Brow » Wed, 13 Dec 2006 22:41:40


You have 3 tables:
- tblProperties
- tblOwners
- tblLINKProperty_Owners (junction between the other two.)

You are adding properties in the main form.
Which table are you expecting to add records to in the subform?
You will not be able to add to both tblOwners and tblLINKProperty_Owners at
once, since the record must exist in tblOwners before its primary key value
is available to use as the foreign key in the junction table.

Your solution of adding the owners in a separate form (or directly into the
table) before appending a record to the junction table makes sense.

You can still use a query as the source for the subform if there are a
couple of fields from the owners table you wish to display. But you need to
be very clear about which table you are appending records to.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://www.yqcomputer.com/
Reply to group, rather than allenbrowne at mvps dot org.
 
 
 

1. What is meant by "Index or primary key cannot contain a Null value

2. Index or primary key cannot contain a null value.

I have a subform (sfrmPKProfilesQualifications) that's used in multiple
subforms. The problem I have is that there are instances when
sfrmPKProfilesQualifications will have a record and it's parent subform will
not. Of course, this results in the error:

"Index or primary key cannot contain a null value."

I suppose an easy fix to this would be to move sfrmPKProfilesQualifications
out of the subforms, however, I wanted to explore if there's a Before/After
Update code that I could insert into it that would create the primary key
record.

Thanks in advance for your time!

--
www.Marzetti.com

3. "Indexed or Primary Key cannot contain a Null value" / Autonumbers

4. Changing "Index or Primary Key cannot contain a null value" message

5. Index or primary key cannot contain a Null Value

6. Index or Primary Key Cannot Contain a Null Value

7. Index or primary key cannot contain a Null value

8. "Indexed or Primary Key cannot contain a Null value" / Autonum

9. Index or primary key cannot contain a Null value

10. Help: Error - Index or primary key can not contain Null value.

11. Use of List box and 'Index or primary key cannot contain null"

12. Invald or Primary Key Cannot contain a null value

13. Primary key cannot contain a null value.

14. Index or Primary Key Cannot Have A Null Value

15. access 2000: index or primary key null value error