Running a Query based on checkboxes

%3CLINGO-SUB%20id%3D%22lingo-sub-3235637%22%20slang%3D%22en-US%22%3ERunning%20a%20Query%20based%20on%20checkboxes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3235637%22%20slang%3D%22en-US%22%3E%3CP%3EIt's%20been%20some%20time%20since%20I've%20worked%20in%20Access%20but%20I've%20been%20tasked%20with%20creating%20a%20database%20of%20certain%20features%20of%20our%20product%20(the%20easy%20part)%2C%20and%20then%20creating%20a%20search%20form%20where%20users%20can%20search%20for%20one%20(or%20more)%20of%20these%20features.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I've%20done%3A%3C%2FP%3E%3CP%3E1%20-%20Created%20a%20table%20with%20about%2040%20checkboxes%20fields%2C%20as%20well%20as%20an%20autogenerated%20ID%20number%20and%20two%20short%20text%20fields%20for%20identifiers.%3C%2FP%3E%3CP%3E2%20-%20Created%20a%20form%20where%20the%20user%20can%20enter%20the%20identifying%20information%2C%20as%20well%20as%20select%20multiple%20checkboxes%2C%20based%20on%20the%20features%20of%20our%20product%20(this%20is%20for%20data%20entry%20to%20populate%20the%20database)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20need%20to%20do%20is%20create%20a%20form%20where%20the%20user%20can%20select%20one%20(or%20more)%20checkboxes%20and%20run%20a%20query%20to%20get%20a%20list%20of%20projects%20that%20have%20this%20feature(s).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20created%20the%20query%2C%20but%20I'm%20unsure%20of%20how%20to%20get%20the%20results%20I%20want.%20I%20suspect%20I%20will%20need%20to%20have%20multiple%20IF%3B%20ELSEIF%20statements%20and%20do%20this%20in%20VBA.%20I%20have%20done%20this%20before%2C%20but%20I'm%20really%20struggling%20to%20remember%20exactly%20how%20it%20is%20done.%20I've%20looked%20at%20old%20databases%2C%20and%20still%20can't%20quite%20wrap%20my%20head%20around%20what%20I%20need%20to%20do.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20have%20any%20ideas%3B%20or%20need%20more%20information%20for%20clarification%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20so%20much!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3235637%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eaccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3237238%22%20slang%3D%22en-US%22%3ERe%3A%20Running%20a%20Query%20based%20on%20checkboxes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3237238%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1321059%22%20target%3D%22_blank%22%3E%40BrendaRichardson%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBefore%20investing%20any%20more%20time%20in%20this%20design%2C%20I%20strongly%20urge%20you%20to%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice%2Ftroubleshoot%2Faccess%2Fdatabase-normalization-description%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3E%20learn%20about%20Normalization%3C%2FA%3E%2C%20i.e.%20the%20process%20by%20which%20we%20design%20and%20create%20relational%20tables%20for%20a%20relational%20database%20application.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22...%3CSPAN%3Ea%20table%20with%20about%2040%20checkboxes%20fields%22%20is%20more%20like%20a%20spreadsheet%20and%20is%20the%20way%20many%20new%20developers%20start%20out%2C%20unfortunately.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Frogersaccessblog.blogspot.com%2Fsearch%2Flabel%2FProblems%2520With%2520Repeated%2520Columns%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHere%20is%20a%20link%20to%20a%20set%20of%20articles%3C%2FA%3E%20that%20describe%20the%20problem%20in%20more%20detail%20and%20also%20show%20you%20how%20to%20correct%20it.%20Later%2C%20when%20you%20have%20a%20proper%20set%20of%20related%20tables%2C%20you%20can%20return%20to%20the%20search%20task.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

It's been some time since I've worked in Access but I've been tasked with creating a database of certain features of our product (the easy part), and then creating a search form where users can search for one (or more) of these features.

 

What I've done:

1 - Created a table with about 40 checkboxes fields, as well as an autogenerated ID number and two short text fields for identifiers.

2 - Created a form where the user can enter the identifying information, as well as select multiple checkboxes, based on the features of our product (this is for data entry to populate the database)

 

What I need to do is create a form where the user can select one (or more) checkboxes and run a query to get a list of projects that have this feature(s).

 

I've created the query, but I'm unsure of how to get the results I want. I suspect I will need to have multiple IF; ELSEIF statements and do this in VBA. I have done this before, but I'm really struggling to remember exactly how it is done. I've looked at old databases, and still can't quite wrap my head around what I need to do.

 

Does anyone have any ideas; or need more information for clarification?

 

Thanks so much!!

 

 

3 Replies

@BrendaRichardson 

 

Before investing any more time in this design, I strongly urge you to learn about Normalization, i.e. the process by which we design and create relational tables for a relational database application.

 

"...a table with about 40 checkboxes fields" is more like a spreadsheet and is the way many new developers start out, unfortunately.

 

Here is a link to a set of articles that describe the problem in more detail and also show you how to correct it. Later, when you have a proper set of related tables, you can return to the search task.

 

@George Hepworth 

 

Thanks for this, but this isn't about relationships; I understand relationships and have developed many databases before. I'm just struggling with the wording for my queries.

 

We have a product that can have many different features - I won't get into details, but they are all unique. I could create 5 tables for the different product lines we have, but at the end of the day, I'm STILL going to have the same number of checkboxes for the features. They are all unique.  

 

With reference to the article you posted, it's not like I have Item A and I'm looking for feature 1, 2 or 3.  I am ONLY looking for features. They referred to patient names and symptoms; there is no patient.

 

I mean, yea, I could put the identifiers in a separate table, but at the end of the day, I'm still going to have 40 unique features.

 

I suppose, alternately, I could create multiple queries for each feature and the user would have to select which feature they are looking for. But that isn't really the path I want to go down.

I can't help. Sorry.