Update: Ok, so now we know that the condition causing the error is that on subforms2 and subform21, the AllowAdditions properties are set to false, except when we are adding records.
I need to protect these subforms from users trying to add sample records if they have not selected a project...