You haven't told us much about your database and tables. If you have a subform, the implication is you have a Form and on that form you have a subform.
In classic Access Form/SubForm, set up to deal with a 1 to Many relationship, the 1 side of the relationship is handled in the Form, and the Many side is handled by the SubForm.
Code:
(1) (Many)
analogy is Parent--->Child
If you are trying to add a new record in the subform, that is not part of the record on the Main form, Access will give an error.
You can't have a Child record, until there is a Parent record