You don't say how your data is structured, but it sounds to me like you have
a many-to-many relationship between documents and folders, i.e. each document
can be in one or more folders, and each folder can contain one of more
documents. To model this you'd need three tables:
1. Documents: DocumentID, DocumentName etc.
2. Folders: FolderID, FolderName etc
3. FolderDocuments: This table models the many-to-many relationship
between the first two by having two foreign key columns FolderID and
DocumentID which reference the primary keys of the other two tables
respectively. It would also have a Boolean (Yes/No) Present column which
records if the document is present in the folder, i.e. the table would have
rows for all documents which SHOULD be in a folder, but only set to True for
those which ARE in the folder. Data entry could be either by a Folders form
with a Documents subform, in continuous form view, embedded in it, or
conversely, by a Documents form with a Folders subform, again in continuous
form view, embedded in it
Schematically the model would look like this, with the < and > signs
representing the 'many' ends of the two on-to-many relationships into which
the many-to-many relationship is resolved:
Folders----<FolderDocuments>----Documents
With the above model the absence of any documents from a folders would be
returned by a query like this:
SELECT FolderName, DocumentName
FROM Folders INNER JOIN
(Documents INNER JOIN FolderDocuments
ON Documents.DocumentID = FolderDocuments.DocumentID)
ON Folders.FolderID = FolderDocuments.FolderID
WHERE NOT Present
ORDER BY FolderName, DocumentName;
You can of course restrict the result set to a particular document and/or
folder by including further criteria in the WHERE clause. If you want to
show both present and absent documents omit the 'NOT Present, criterion from
the WHERE clause and include the Present column in the SELECT clause.
Remember that if you include spaces or other special characters in table or
column names you must enclose them in brackets [like this] in the query.
Ken Sheridan
Stafford, England
jamiepgs said:
It's been a while since I learned how to use Access 2003, and I have some
trouble.
I have made a checklist which I check if a document is found in a certain
folder. If a document isn't found, a letter has to be sent to a provider to
send a copy of the document. To make my life easier, I've made a mail-merge
document.
I need to create a query that will display the options that are false only.
"=no" doesn't work because it only shows records where all documents are
missing, but the documentsmissing isn't the same.
Also, when I enter the field into the mail-merge, it show true or false, is
there a way thatwill display the name is the value is false?
Thanks a bunch