Web Development

General discussion


Access 2000 NotInList event procedure

By Kevin at Alexander Group ·
I created a NotInList event to allow the user to add a new record to the source of a combo box. The event procedure opens a form to add a new record and passes the argument from my combo box to the appropriate form field. When you click Okay, the form becomes invisible and the acDataErrAdded response is passed back to the first form to requery the combo box list and add the new entry. Then the form is closed.

This technique is used several times in my database, but I only have problems inone spot. The combo box lists an informational field, but is actually bound to a primary key from a table. This primary key is also part of a one to many relationship. The point of the combo box is to add a record to the many side of the relationship in a join table (for purposes of creating a many to many relationship with another table).

The problem is that the form executes and adds a record to the table on the one side of the relationship, but when the procuedure ends and the new value is selected in the combo box, the following error appears.

The current field must match the join key '?' in the table that serves as the 'one' side of one-to-many relationship.

Help on this issue provides the following error number (Error 3341).

The whole purpose of the procedure is to add a record to the one side of the join. The record is added successfully, but for some reason this message occurs and the form will not save.

I am at a complete loss and would appreciate some help.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Access 2000 NotInList event procedure

by donq In reply to Access 2000 NotInList eve ...

You might try setting the combo box value within your procedure via a "Dim" statement and use this temporary value throughout your code. Be sure each instance is processed if you are processing more then ne record.

I wasn't real sure what you were doing but it sure sounded good??? Don Quigg

Collapse -

Access 2000 NotInList event procedure

Resolved issue by changing the form concept.

Collapse -

Access 2000 NotInList event procedure

This question was closed by the author

Related Discussions

Related Forums