Error Trapping

  • Thread starter Thread starter Jesse via AccessMonster.com
  • Start date Start date
J

Jesse via AccessMonster.com

I am new to error trapping in access and I have a question. I have a form
that has several subforms in it. Each subform has a table that is related to
the main form. If I create a new record and move to one of the subforms, I
get an error 3201 that there has to be a related record in the main table.
Is there a way to trap for this error so it doesnt come up? If so which
event should it be done in?

Please help.

thanks
 
Yes, it can be trapped. You would probably trap this type of error in the
form's Error event. However, this type of error is telling you about a real
problem that you need to correct and that would be the best way to fix this.

The 3201 error means that the table you just tried to create a record in is
on the many side of a one-to-many relationship and there isn't an associated
record in the table on the one side. If you continue to create this record
without the associated record, you will have a lost child record. You need
to create the record on the one side of a one-to-many relationship first.
 
Back
Top