Solved

Filter lookup using subdatasheet???

Posted on 2004-03-23
10
722 Views
Last Modified: 2010-08-05
In Access I have the following tables: Items, ItemsStyle, ItemsSize, and Sizes.  
You can have 1 Item with multiple ItemStyles (Infant, Toddler, Youth, Woman, Man) and each ItemStyle can have multiple ItemSizes (Small, Medium, Large, XL,....).  I have this setup so I can see subdatasheets by clicking the + on an item and see the itemstyles and click the + to see the itemsizes. When I click the first record I see
-1,item 1
  -Infant
    6/9
    12
    18
    *(dropdown list I want to filter based on the the style I clicked 'infant')
  +Youth
  +Toddler  (if I click + to expand toddler I only want to see sizes for toddler in the dropdown lookup and not see infant or youth sizes)

Can I do this?
0
Comment
Question by:hbaber
  • 5
  • 4
10 Comments
 

Expert Comment

by:robiago
ID: 10664278
could we pls have a little detail on the structure of tables:

ItemsStyle and ItemsSize
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10665066
The + structure will work in tableview and can be set following the instructions when you press the +
The dropdownlist you can achieve by changing the fieldproperty in access to a lookup field (See secon tab in field definition) just make the field to be looked up in a table and your combo will appear.

Nic;o)
 
0
 
LVL 1

Author Comment

by:hbaber
ID: 10668750

Take a look at http://www.knology.net/~hb/accesshelp.jpg to see the DB structure and what I am trying to do.

I have the lookup working it just doesn't filter dynamically.  I would guess I need to create a view and use VBA to get the value of what was clicked in order to pass it.  I don't think I can do this with a simple lookup from inside a table/subdatasheet.
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 54

Expert Comment

by:nico5038
ID: 10668845
Hmm, you want something we normally code as cascading comboboxes.
This is however possible when directed from code. I'm afraid you can't include such a criterium here when working with this linking feature.
Can you switch to using forms ?

Nic;o)
0
 
LVL 1

Author Comment

by:hbaber
ID: 10668856
No problem, I can switch to forms.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10668947
Hmm, looking again to the structure made me wonder or you have multiple ItemStyleID's for the same CollectionID.

Looks to me your SizeID field should be splitted in two fields as it looks to hold the Collection and a "lower" level.
Having the SizeID splitted will allow the original design when you relate the tables by CollectionID....

Nic;o)
0
 
LVL 1

Author Comment

by:hbaber
ID: 10669266
Here is the database.  http://www.knology.net/~hb/slt.mdb  The SizeID joins to the Size table which has two fields for size and collection.

0
 
LVL 54

Expert Comment

by:nico5038
ID: 10669526
Hmm, just curious why you make this so "complex".
Looks to me you have items and styles/collections.
The ItemStyle table defines what combinations are possible.
And in the ItemSizes the different sizes can be recorded, but why there's a style/collection field isn't clear to me.
When you want to limit the number of sizes, this can already be done using the ItemSizes that are styles/collections related.

Nic;o)
0
 
LVL 1

Author Comment

by:hbaber
ID: 10670195
I thought it would make it cleaner and easier to query later by normalizing wha tI could.  My thought was I have an item (shirt) which can be sold in styles (Infants, Youth, Women, Men ....) those styles come in different sizes for each style.  That is why I have 3 tables.  If this is not correct I/we can change it.  No problem.  I want to try to avoid keying/typo errors.

If you want to modify and post something for me to download I will take a look.  
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 200 total points
ID: 10670364
Hmm sounds reasonable to limit the sizes per style/collection, but then I would create a Style/Size relation table.
Now you're creating multiple rows with the same size just with a different "collection".

The size in the itemsize can be taken "straight" from the size table and the Style/Size can be used to "guard" that only "allowed" sizes can be selected.

See my point ?

Nic;o)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question