Subform Index or Primary Key Cannot Contain Null Value

Akirien

New member
Local time
Today, 22:05
Joined
Jan 21, 2010
Messages
1
Hello there... I am having trouble adding the data into the subform... The error said Index or Primary Key Cannot Contain Null Value. I have attached my database here. Can anyone help me? Thank you :)
 

Attachments

The subform is based on the Registration table.
Its primary key is not an autonumber so needs to be added manually.
There's nowhere in the subform to do that.

So, add the RegistrationNo field to the subform.

However, because the subform is based on the same table (Registration) as the parent form and linked by the same field in the same table (Registration.StudentID) then adding a record to the subform also adds a record to the parent.

That is a bizarre thing to do with a subform and I suspect not what you had in mind. Normally subforms represent the many part in a one to many relationship between two tables with the parent representing the one.

Basing the subform on the same table as the parent form is pointless and confusing for the user unless it's some very devious little trick to produce some desired behaviour I can't imagine.
 

Users who are viewing this thread

Back
Top Bottom