View Full Version : Inverse Report


veebs
10-28-2009, 05:07 PM
Hi all,

Long time reader, first time poster. I'm in a bit of a pickle...

I have what is essentially a one-to-many database, used to track training completed on an industrial site. The 'one' side stores the employee name, birthdate, address, etc. The 'many' is a list of training they have completed, and the date they completed it. The training options are based on a list stored in a third table (ie, the data admin is allowed to chose only pre-defined training packages).

I've been asked to include a report, which will return the names of all personnel in the system who have not completed a given item of training. In other words, show all 'One' records, that don't have a particular 'Many' related to them.

Any ideas?

Edit: I'm using Access 2007

pbaldy
10-28-2009, 05:15 PM
First create a query that returns those who have taken the course. Then use the unmatched query wizard to compare the employee table to this new query. That should give you the people who have not taken it.

veebs
10-28-2009, 06:34 PM
Success!! Haha :) Thankyou pbaldy!

pbaldy
10-28-2009, 06:56 PM
No problem, and welcome to the site!

veebs
11-01-2009, 03:40 PM
Me again, with another conundrum. I'm not sure if I should repost in a new thread or not, but i'll start here first...

I now need to restrict our data entry clerks from entering the same item of training twice. Essentially, making the training name field (a lookup, and thus only storing a number) as a unique number, but only for the given reference ID (the ID of the parent personnel record)
Is this possible?

pbaldy
11-01-2009, 05:41 PM
Sure, a couple of ways. You can set up an index on the two fields. Look at index and constraint in help. You can also test in the before update event, using either a recordset or DCount to see if the input combination already exists. Or you can take the "belt and suspenders" approach and do both. :p