Solved

Filter lookup using subdatasheet???

Posted on 2004-03-23
10
729 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

679 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