Datasheet Form with combo list

Erick

Active Member
Joined
Feb 26, 2003
Messages
362
If I have the following data source (either table or query) with 3 fields (id, type, colour)

ID-----Type-------Colour
1-------A----------Red
1-------A----------Blue
1-------A----------Green
2-------B----------Red
2-------B----------Yellow
2-------B----------Purple
2-------B----------Green

I need to create a Datasheet Form to list the above data with distinct ID (so in this case, it will only show 2 records). However, for the colour field, I need a dropdown combo list to give the relevant options. So the datasheet form will look like this:
ID-----Type-------Colour
1-------A----------(Combo list: Red, Blue, Green)
2-------B----------(Combo list: Red, Yellow, Purple, Green)

I just can't work out how to filter the combo list record to only show the ones relevant for the type.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
You need to make the second combo use the value from the first in its criteria. Here is a link that shows the technique.

Denis
 
Upvote 0
What you really need is a table for your colours. So, like this:

tlkpColours
ColourID - Autonumber(PK)
ColourName - Text


and then you would have a separate types lookup table as well

tlkpTypes
TypeID - Autonumber (PK)
TypeDesc - Text

And then a junction table where you can assign the types to the colours

tlkpColoursTypes
ColourTypeID - Autonumber(PK)
ColourID - Long Integer (FK)
TypeID - Long Integer (FK)


Now with that you can assign whatever you need for types and then also you can have your colours in the combo but with the linked table you can also limit by type but only bring back the ones you need.
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,319
Members
452,905
Latest member
deadwings

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top