Ms-access – How to update a yes/no field to yes when all related fields in another table are marked yes

database-designms access

I'm new to database stuff (read: database idiot) and I am using Access. I have a table (let's call it "projects") that has a list of projects and one the fields (let's call it "actions_complete") for each of the projects is basically "are all the actions related to this project complete?" There is another table (let's call it "actions") that has broken down all the actions related to each of the projects and a field (let's call it "complete") that documents whether or not that specific action is complete.

What I want is for "actions_complete" in "projects" to change to a yes value once all of the "complete" values for a corresponding project are marked as done.

I took a database class in college but I retained very little information from then because I had never worked with databases and then I went and taught English for two years (where I forgot everything IT-related about my degree) on the other side of the world and now I'm working in a place where some basic database administration skills would be very helpful. I'm super grateful to the community here at StackExchange and I'll be very happy if anyone is willing to explain to me how I can get this done or if it's even possible. I'm sure it's much easier than I'm imagining.

Best Answer

In general a design like that is a bad idea, a better idea would be to start using a view, and in that view you add a column where you calculate if all subtasks are done or not. That way every time you query the view you calculate the correct value without having to rely on things like triggers to update your actions_complete every single time something happens.

Related Question