From your description, the problem I suspect has to do with the definitions of the tables, and some of the form properties. I dont think has anything to do with the subform events Anyway, try the following:
(a) Set DataEntry to false. This will allow the form to expose ALL of its underlying records; not just new ones. Perhaps you are trying to add a new record without realising that it has been added before, because of the setting of this property.
(b) Check out the table definition of the table bound to the main form. Identify which field is the Primary Key, and confirm that this is the field that you indeed want to be unique in the table.
(c) Problems with the code are most likely to be in the OnCurrent or BeforeUpdate events of the main form and will cause your problem if the value associated with the PrimaryKey is incorrectly autogenerated (to be non unique) by this code. When you move from the main form to the subform, the BeforeUpdate associated with the main form is triggered and the main form's underlying record is saved, as you move off the main form into the subform. This is the point that your program is complaining.
(d) Another angle; try saving the main form record without moving into the subform (eg. display the main form record selector bar, and click to save when you have entered your data). If the problem occurs, then you've eliminated the subform as a candidate problem.
Cheers,
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au