no matching record on the "one" side in one-to-many relationship

L

ll

Hi,
I am working with several tables, including an Employees table and an
Order table. There is an order form which has a drop down box to
select the employee name from the Employees table, as well as a drop
down to select a product to be ordered. If the product drop down is
selected before the employee one, then the following error occurs:
=============
The Microsoft Jet database engine cannot find a record in the table
<name> with key
matching field(s) <name>. (Error 3101)
In a one-to-many relationship, you entered data on the "many" side for
which there is
no matching record on the "one" side. For example, this error occurs if
you join a
Customers table and Orders table on a CustomerID field, and then add an
order using a
CustomerID that does not exist in the Customers table.
=============
I had thought of making the product drop down invisible until the
employee drop down was completed, but was wondering if there was a way
to solve the 'true' cause of the problem?

I have 4 tables: Products (productID - key linked to ProductID in Order
Details table), Order Details (orderID and ProductID - keys, linked to
OrderID in Orders table and ProductID in Products table, respectively),
Orders (orderID - key [same as orderID in order details table]), and
Employees (employeeID - key, linked to employeeID in Orders table).
Between Orders and Order Details tables, there is a 1 (Orders table) to
many (Order Details table) relationship.

Thanks for any suggestions.
Louis
 
S

Smartin

ll said:
Hi,
I am working with several tables, including an Employees table and an
Order table. There is an order form which has a drop down box to
select the employee name from the Employees table, as well as a drop
down to select a product to be ordered. If the product drop down is
selected before the employee one, then the following error occurs:

The usual way to do this is create a form based on employees with a
subform based on orders, linked on the employee. Since products belong
to orders, and orders belong to employees, this will prevent a product
from being selected before an employee order is established.

If employees can have multiple orders the design gets more interesting,
but have a go at this much and see if it helps.
 

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

Top