Microsoft Jet Engine Error Message

G

Guest

Hello,

I built a purchase order form from a query in order to autofill information
such as Employee for who completed the purchase order, Ship to and Vendor
information from combo boxes. It works, but until you select select from the
combo boxes first on the form I keep getting the same error message:

Microsoft Jet Database engine cannot find a record in the table "Vendors"
with key matching field(s) 'VendorID'

I get the same error for the ShipTo and Employees as well when there is a
ShipToID, EmployeeID and VendorID in the table.

These are the control sources, but I have them display/autofill the Name and
address info for all three. Everything works, pulls the correct info, but
this error message is an annoyance and don't know what to do to fix the
problem.

Thank you
 
K

Ken Snell \(MVP\)

The error message is saying that a record being added to a child table (one
related to Vendors table by VendorID) has a value for the foreign key (the
one that links back to Vendors) that does not exist in the Vendors table.
Often, this error occurs if you did not change the default "Default Value"
for the foreign key field when you created it in the table. ACCESS defaults
to a default value of 0 for a long integer field when the field is created;
open the table in design view and see if that is the problem. If yes, delete
the 0 value from the Default Value property for the foreign key field.
 

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