Solved CheckList Database Help Required

Uncle,

Trying it on my machine I put a msgbox at the beginning and end of call. Gets hit BOTH when you press the button and when you come back to the form. Looked at the table after pressing the button and no new entries. Both look to have the exact same parameters and values. Haven't had a chance to look again as I'm getting over a migraine.
 
Uncle,

Trying it on my machine

Hi Mark, The actual database in this thread isn't mine it was created by somebody else. I have deliberately not provided a sample database because the idea is that people follow the instructions I provide on my website here:-

Add a Check List to your MS Access Database

and build their own example. The idea is to encourage people to learn MS Access by doing. Providing a sample database is counterproductive to the learning process.

Now having said that I am quite sure my instructions are not comprehensive and I may have missed out important points.

However to develop the teaching aspect further it is important that people address these points, telling me the bits that don't make sense, and then I can correct my teaching blog.

This will make it helpful to more people.
 
In this blog I demonstrate some useful things you can do if you set up this checklist in your database.

Check List Extras

Update the Checklist Automatically
Checklist - How to Check ALL
Checklist - Serial Number Collector
Checklist With Multiple Choice
 
@ CuriousGeo,

Found the other problem. Your child records are related to your parent record. You haven't saved your parent record PRIOR to adding the children. You need to save the parent FIRST so it exists, then call your routine.
 
Thanks Mark. That isn't something I even knew about. I guess I could figure out a way to save the parent record before calling the requery. Thanks for that insight!
 
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