Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Cannot Find Record Matching Field
Ken Dianovich 
     
47 days ago
I am getting the following error in my Access Database when I am in a Form and go to close it

"The Microsoft Access database engine cannot find a record in the table 'HospitalContactT' with key matching field(s) 'HospitalContactID'"

Any suggestions would be greatly appreciated.?

Raymond Spornhauer  @Reply  
          
47 days ago
Is this only happening on New Records?

If you have code running on the Form Close or Form Unload referring to a record that doesn't exist (because it's new and not saved to the table) you will get this error.

-Raymond
Juan Rivera  @Reply  
            
47 days ago
I think check to see if recorord is dirty and perform an undo. you may be trying to close a form before its saved.  
Undo
Dirty

Donald Blackwell  @Reply  
        
47 days ago
To piggyback on Juan, or perhaps there may be some code looking for the ID of a deleted record, if you allow deletes.

Ken Dianovich OP  @Reply  
     
46 days ago
I believe my Issue is when I am using Different Tables within the Form, just need to figure out how to do that without the error.
Juan Rivera  @Reply  
            
46 days ago
It sounds to me like you may need to use recordset.
Richard Rost  @Reply  
           
44 days ago
That error usually means Access is trying to save or reference a child record that doesn't have a matching parent record.

For example, if you have a one-to-many relationship set up with referential integrity, you can't have an Order record without a Customer record, or an Order Detail record without an Order. If Access can't find the parent record that matches the foreign key value, you'll get an error like the one you're seeing.

Since the message specifically mentions HospitalContactID, I'd start by looking at any tables, subforms, combo boxes, or code that reference HospitalContactT. Make sure you're not creating or saving a related record before the corresponding HospitalContact record exists. Also check any form events (Before Update, After Update, Close, Unload, etc.) that might be trying to save data to another table.

If you're using multiple tables on the same form, as you mentioned, that's likely where I'd focus my attention. Verify that the records are being saved in the proper order and that all foreign key values point to valid parent records.

See: Widows & Orphans
Ken Dianovich OP  @Reply  
     
42 days ago
Yes I think what was happening, I would put some info into my form and not complete the form, so when I was stopping to chek, I was actually creating an issue. If I put all the info into the form, filling out all the fields and then check it, works fine. Thanks for all the comments and help.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 7/27/2026 6:56:20 PM. PLT: 1s