Error 3101 for illogical reason

  • Thread starter wraith199 via AccessMonster.com
  • Start date
W

wraith199 via AccessMonster.com

I have a function that searches a table and returns the ID number of the
record if found - The function is assigned to a text box so that it will
store this ID in another table in order to relate the former table record to
the latter's record. When I send a call to the refresh procedure (or
basically attempt to save the record), I get an Error 3101:
"The Microsoft Jet database engine cannot find a record in the table <name>
with key matching field(s) <name>. "

This is completely bogus as it has taken the ID number directly from the
table it is attempting to relate to and assigning it to the feild which
relates to the field this number was stolen from - obviously the record is
there otherwise it wouldn't have returned the ID number (I've gone through
line by line and checked the variables, it returns the right number).

Here's the data entry procedure to give a better idea of my DB structure:
-User adds an applicant
-User enters an employer identifcation number for this applicant
-database searches for a matching identification number, returns the ID of
the resulting record and assigns it to the applicant table field which is
related to the ID field of the employer table
-form refreshes to show employer information based on the relationship

Why is it doing this?
 
W

wraith199 via AccessMonster.com

Problem solved:

Turns out I had used the wrong Location ID field in my underlying query so
basically it was assigning it's own ID to itself and trying to relate it to a
Null value - hence the "not found" error

My apologies for the thread.
 

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