Solved CheckList Database Help Required

You need to save the parent record BEFORE you add child records.

Look at your relationships. As you have tblMaster as the PARENT to tblData, ACCESS won't let you create orphans by adding records to tblData if the parent record (defined by datalinkID) does not exist.

Note on naming conventions. You will want the same field name in the parent and child for relating. MasterID should be the same in both parent and child records. This avoids a LOT of headaches when trying to remember HOW you linked tables together.
 
You need to save the parent record BEFORE you add child records.

Look at your relationships. As you have tblMaster as the PARENT to tblData, ACCESS won't let you create orphans by adding records to tblData if the parent record (defined by datalinkID) does not exist.

Note on naming conventions. You will want the same field name in the parent and child for relating. MasterID should be the same in both parent and child records. This avoids a LOT of headaches when trying to remember HOW you linked tables together.

SOLVED...Thank you Mark!

I was able to get the list to insert itself into the record. I added an after update event on a field in the form to save the parent record (DoCmd.RunCommand acCmdSaveRecord). Then my second after update event (which is the Requery of the subform) happened automatically as it should.

Also, I will change the naming of parent/child related keys, so it is easier to keep track of.
 
I just wanted to repost a generic version of the database if it helps anyone. It's not really a "checklist" anymore (but you could add the Yes/No checkbox back in). It's more of a list with responses available for items in the list.

As Mark pointed out some things, the record needed to be saved before the list could be added. So I modified some events. I have a field (Person) that saves the record after update-you could change that to something else to suit your need. Then, I added a button to add the list (which is actually a requery) of the subform.

If anyone finds it useful, it can be easily modified for your purpose. My original intention was to build something for my workplace to replace paper quality control forms and have the documentation stored electronically and easy for the end-user to fill out. The list (for an instrument we use) is the same set of solutions for each day. The items in the list have changes available to them in a combobox.

Thanks to farhanleos and arnelgp (I modified their original db's), Mark, Uncle Gizmo (great tutorials!) and everyone else who contributed.
 

Attachments

Last edited:
Can you please mark the thread "Solved"?

Your very welcome for the help!
 
Ah, you just hijacked it. Can't close it then.
 

Users who are viewing this thread

Back
Top Bottom