Error Trapping

  • Thread starter Jesse via AccessMonster.com
  • 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
 
W

Wayne Morgan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Refresh data in sub forms when one sub form is edited 4
Multiple subforms 0
Intrinsic Error message in Access97 1
Which event? 5
Trapping Error 3101 5
Kill Focus on Subform 2
Error 3201 Help!! 3
Error 3201 1

Top