473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Too many checkboxes to handle

Hello,

I had an Access database that would classify items with one classification, and then classify one sub-classification based on the selection for the main classification.

This worked well, but did not provide the granularity that was needed. What I needed was to have multiple selections available for each sub-classification, and the ability to select as many of these “sub-sub” classifications as applicable. I set out creating tables for each sub classification with the identical fields in each table: ItemID, ClassificationType, Classification SubType, then a series of unique checkboxes for that sub classification type. I used a tree-view control where the classification types were the 1st level, and the sub types were the nodes. Clicking on a node opened a subform with all the check boxes from the corresponding table, that allowed for easy data entry.

Now I am stuck trying to combine the data from each table so that I can do trending based on the Classification type, or sub-type. I tried by doing a union query to combine the ItemID, ClassificationType, and ClassificationSubType fields from each table and put them in a new table. I then used that new table as a basis for combining all the subtype tables together. The problem I have now is when I change the criteria for the query to show only a specific classification sub type, the correct records show, and the corresponding check boxes are checked, but I end up with a huge number of blank columns- all the checkbox columns that correspond to other sub-types that I am not interested in for this particular query?

Eventually, i want this query to be based on a multiple selection list box so that I can choose (for example) subtype A,B, and D, and have only those corresponding records show.

Can anyone kick me in the right direction?

Thanks!

Ben
Aug 26 '08 #1
3 2116
Stewart Ross
2,545 Expert Mod 2GB
Hi Ben. Problem is that you have defined separate tables for each sub-classification instead of containing all of these in one table with an additional attribute specifying the sub-class type. The giveaway is when you wrote that the tables are identically structured.

In relational table design it is quite possible to have relationships where a table relates to itself. It isn't commonplace, but it does arise quite naturally (for example, a 'managed by' attribute of a staff table, as managers are also staff themselves.) This is the case here; a class relates back to a class through a sub-class attribute of some kind.

In Access such recursive relationships can be set by dragging two copies of the same table into the relationships window and setting a relationship from one of the copies to the other (Access cannot show or set a recursive link in the standard notation of a loop line linking fields to and from the same table).

You will need to resolve your many-table approach to subclasses and merge these as appropriate before you will resolve the difficulties you are experiencing. This is a fairly large task as it involves a complete rethink of your current approach. It is worth doing, however, as you will not be able to exploit the power of relational queries with your current design, no matter what you do.

-Stewart
Aug 27 '08 #2
I understand the issue, and i actually have a classification type and sub type field in each table set to default to the sub type that that field's checkboxes are based on so that they can be related. Once i did the merge, i effectively have one large table with all the records. i know that it wasn't ideal, but it allowed the check box fields of each sub type to be seperate tables, instead of burried in one massive table. If i take that new table that was created as a result of the merge, would i be able to do that recursive relationship? I could even save the table, and then use the massive combined table in the future insead of the individual tables. The issue i am still having is that with the massive combined table, there are 3 fields that are the same... [ID] [Type] [Subtype] but following that are 300 checkbox fields, with certain checkbox fields pertaining to one subtype, and other checkbox fields pertaining to another subtype.

I am still struggling with designing a query that will be able to show me only the checkboxes of the subtype i am interested in, and not all the other blank/null fields. They are null because they pertain to different subtypes that i am not querying for.

Any thoughts?

Hi Ben. Problem is that you have defined separate tables for each sub-classification instead of containing all of these in one table with an additional attribute specifying the sub-class type. The giveaway is when you wrote that the tables are identically structured.

In relational table design it is quite possible to have relationships where a table relates to itself. It isn't commonplace, but it does arise quite naturally (for example, a 'managed by' attribute of a staff table, as managers are also staff themselves.) This is the case here; a class relates back to a class through a sub-class attribute of some kind.

In Access such recursive relationships can be set by dragging two copies of the same table into the relationships window and setting a relationship from one of the copies to the other (Access cannot show or set a recursive link in the standard notation of a loop line linking fields to and from the same table).

You will need to resolve your many-table approach to subclasses and merge these as appropriate before you will resolve the difficulties you are experiencing. This is a fairly large task as it involves a complete rethink of your current approach. It is worth doing, however, as you will not be able to exploit the power of relational queries with your current design, no matter what you do.

-Stewart
Aug 27 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
... but following that are 300 checkbox fields, with certain checkbox fields pertaining to one subtype, and other checkbox fields pertaining to another subtype....
which tells me again that the table has not been designed relationally. It is certain that if you have that many fields you either have repeating groups of some kind, or entities which should be separated. In other words, your design is not likely to be in first normal form never mind third normal form / Boyce Codd normal form.

Relational database design rarely leads to tables with more than 50 fields, even in complex systems. The norm is for no more than low teens to twenties of fields in any one table, but many inter-related tables.

We have an excellent HowTo article introducing database normalisation and table structures, which might help you here.

In answer to your question on the merged table, yes you can set a recursive relationship after merge, but I would hold off on that until you resolve the normalisation as it will undoubtedly lead to what is in one table at the moment changing to more than that afterwards.

-Stewart
Aug 27 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Brian | last post by:
On a photographer's web site, I have a catalogue page that lists all the photos available for purchase. It is marked up as a table, with 1 column for the image title, a second for the material on...
1
by: CViniciusM | last post by:
Hello, I have used the code below (into the oncreate method) to get a treeview with checkboxes: HWND handle = TreeView1->Handle; value = GetWindowLong(handle, GWL_STYLE); if(value) { value =...
4
by: Erwin Moller | last post by:
Grrr, Forgive my ranting, but this really irritated me a lot. <ranting> I have a page with X checkboxes with the same name. code like: var numberofCB =...
2
by: Glenn Owens | last post by:
Can someone please explain the rationale behind not putting a checkbox reference into the postback data collection? I have a composite control (supporting IPostBackDataHandler) which populates a...
7
by: DJ Dev | last post by:
Hi All, I have a complex problem. I have dropdownlists (usually 3-5) and the user selects some value from these and for each value selected, datagrids are shown to the user. I am creating the...
3
by: somaskarthic | last post by:
Hi How to get the values of dynamically created checkboxes which are checked and unchecked (for both the conditions). Only the selected checkbox values are posted as 'On' . How can i get the value...
3
by: wbosw | last post by:
I'm trying to create a simple shopping cart, so when the multiple checkboxes on the UI are checked the objects are added to the database. My question is how would I handle checking to see which...
4
by: jeet | last post by:
Plz help me.Problem is that On the first page I display all other user with checkbox and give user option to select only two user which he wants to send message. Tell me please how I'll get those...
2
by: GISmatters | last post by:
I have unbound checkboxes in a nested gridview to allow multi-selection of "child" rows. For context, the parent gridview rows are for large "reports", the child rows are for various specific files...
3
sunbin
by: sunbin | last post by:
Hi, I am having in a Trouble when working with dynamic checkboxes (i.e. checkboxes with the same name, e.g. <input type="checkbox" name = "check" value="dynamic integer value">) I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.