Query Set-up with NOT

T

TitaniaTiO2

Ok I am not sure how to set-up this query / code

My tables are:

tblPerson
PersonID
LastName
FirstName

tblDocument
DocumentNumber
DocumentTitle

tblTraining
TrainingID
PersonID
DocumentNumber
....

I want a form where I can select a DocumentNumber from cmbDocumentNumber
(list of all distinct DocumentNumbers from tblDocument (Know how to set this
part up)

I then want to display a listbox that shows only the employees NOT trained
to that DocumentNumber


Maybe I am just having a brain fart.

The problem is that when I set up my attempts at the query, it only shows
the employees that are NOT trained to Document X but are trained to some
other document. I want it to show employees even if they are not trained to
any documents

Thanks for the help!
Does this even make senese?

Titania
 
P

pietlinden

Ok I am not sure how to set-up this query / code

My tables are:

tblPerson
   PersonID
   LastName
   FirstName

tblDocument
   DocumentNumber
   DocumentTitle

tblTraining
   TrainingID
   PersonID
   DocumentNumber
  ....

I want a form where I can select a DocumentNumber from cmbDocumentNumber
(list of all distinct DocumentNumbers from tblDocument (Know how to set this
part up)

I then want to display a listbox that shows only the employees NOT trained
to that DocumentNumber

Select tblDocument.DocumentNumber, tblPerson.PersonID
FROM tblDocument, tblPerson
WHERE DocumentNumber=Forms!MyForm!cboDocumentNumber

gives you a deliberate cartesian product. Then you can subtract.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top