Access 2000 NotInList event procedure - TechRepublic
General discussion
January 2, 2001 at 12:39 PM
kevin at alexander group

Access 2000 NotInList event procedure

by kevin at alexander group . Updated 25 years, 5 months ago

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 discussion is locked

All Comments