Access help needed. Validating data in one table based on data in another

Man of Honour
Joined
17 Oct 2002
Posts
50,386
Location
Plymouth
Hoping someone can help me with this, my access stuff is a bit rusty.

I'm working on something where there is a table for primary jobs, with an associated table with sub-jobs on a one to many relationship. Each sub job has a completed yes/no entry, as does each primary job.

What I want to do is to make it so you cannot set the complete field in the primary job table to yes if there are linked sub jobs where the complete field is set to no.

Any thoughts on the simplest way to do this?
 
All data changes are done using forms, the users will be unable to access the tables directly.
 
I'd imagine you could add a bit of VBA code utilizing IF statements or attach a macro to the 'onclick' event of a submit button or similar. Thats the way i did last time, but im sure there are quicker/more efficient ways.
 
I'd imagine you could add a bit of VBA code utilizing IF statements or attach a macro to the 'onclick' event of a submit button or similar. Thats the way i did last time, but im sure there are quicker/more efficient ways.

That's my thought too, or to the 'onupdate' property of the checkbox in question.

The problem is my vba and sql is really rusty after 5 years of non-use.
 
Back
Top Bottom