could someone help me with this

helloworld

Registered User.
Local time
Today, 14:38
Joined
May 18, 2004
Messages
62
Hi there,

I have got a form where I have three foreign keys in them. when I try to save a record, it gives me this error message.

"The Microsoft Jet Database Engine cannot find a record in the table [name of table where the foreign key is being linked from] with key matching field(s) [name of foreign key]"

Now I have a Message box in my code that pops up when the field is not filled in. How do I get rid of this error? Any help would be great!
 
If the foreign keys are optional, make sure that the default defined in the table is null. It is probably 0 right now. Just delete the 0.
 
Hi Pat,

Thanks for your reply. However, I am still getting that stupid message. Any further thoughts?
 
Yeah...I am pretty sure they are. However, what type of link should I be using(1, 2 or 3)?
 
Sorry, for some reason I thought you were using a form/subform.

Does the record save when all three foreign keys are filled in with valid values?
 
Yes it does. I dont know why this it is doing this. the message only comes up when I click the close button or to go to design view however. It does not show up when I click the save button.
 
You may have code in some event that is dirtying the record. Access automatically trys to save the current record, if it is dirty, when you close the form or scroll to a different record. You NEVER have to specifically save a bound record. Access takes care of it for you.

Also, check the default value for the foreign keys in the form's controls.
 

Users who are viewing this thread

Back
Top Bottom