Duplicate key error on data entry with subforms

V

Veus

Hi,

I have a main form which contains course information.

I also have two subforms which contain the equipment for that course
and any breaks the course has.
These are linked in a one to many relationship with the main form.

When i fill in information for the course, and then move to the subform
and enter something there everything seems to happen ok.

When i then try and select another control on the main form or other
subform, it says that there is a duplicate key on the main form.

I assume because access as inserted the record when i move to the
subform, but then tries to add the same record again (using the same
ID, which is the PK).

How can i tell access not to perform another insert with the same
information?

Or if you have any other strategies on adding information to a table
and other tables in a one to many relationship i would be grateful.
 
N

Nick 'The database Guy'

Hi Veus,

Have you looked at your child & parent fields within the subform?

Good luck,
 
V

Veus

Thanks for the reply.

For some strange reason the child and parent fields decided to set
themselves to the same field. I changed them to the correct fields and
i no longer get that error.

I am getting a #Deleted error on the subform when i click on a control
elsewhere.
Im using mysql as the BE and have made sure that a primary key is set
and that the tables have a timestamp field in them.

Any ideas?
 
Top