?
Solved

Filter lookup using subdatasheet???

Posted on 2004-03-23
10
Medium Priority
?
738 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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 800 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

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.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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 Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

770 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