Query with multiple fields to filter

  • Thread starter Thread starter grullablue
  • Start date Start date
G

grullablue

Guest
I am terrible with databases, but have designed a database that uses two text field types and 48 Yes/No check boxes. The two text fields describe documents (name and location), and all the check boxes indicate what types of documents they are.

What I need to do is to be able to run queries or reports where I can select CERTAIN of the Yes/No field types. For example, some of those check box fields are named 1A, 1B, 1C, 2A, 2B, 3A, 3B, 3C, 3D, 3E, 3F, 3G, (up through 8E) etc.

How can I get the query or report to bring up all of the records that have a check mark in either 1A, 1B, "or" 1C plus list the Field 1 and Field 2 that are text fields? I don't want it to list every record in the database, which is what is happening, because I want to then be able to sort the results.

I know it USED to be in my head how to do this, but I just can't seem to get it to work!

Thanks,

Toni
 
Your structure is incorrect. It needs to be normalized. Something like this:

tblDocuments
DocumentID (Primary Key Autonumber)
DocName
DocLocation

tblDocType
DocTypeID (PK Autonumber)
DocumentID (Foreign Key)
DocTypesID (FK)

tluDocTypes
DocTypesID (PK Autonumber)
DocTypesCode (1A through 8E)
DocTypesDescription

Now you create a record in tblDocType for each Type applicable to a document. Use a main form bound to tblDocuments and a subform bound to tblDocType linked on DocumentID. The subform would have a single visible control to select the code.

From there is very easy to do a query for whatever DocTypes you want.
 
100% over my head

Shoot...that was like reading a foreign language to me. :) I can tell I did something wrong (structure incorrect).

Each of my documents fits several of the 1A, 3C, 8E check boxes. Since each document can have from one to several of those categories, I made check boxes and clicked the boxes that described the document.

Each row in my table has a name in the document name text field, and then some check marks where applicable.

Is it possible to have Access list only the documents that have certain check boxes (without knowing programming), or should I do this by hand?

Toni
 
Toni,

You are missing the point. This can be done VERY easily if you use a normalized structure. Just follow my suggestions for table structure. If you have been entering data we can help you transfer the data to the correct structure.

Once you have this strucutre, you can create a query using Query Design mode, that will list just the types you want.
 

Users who are viewing this thread

Back
Top Bottom