Bruno Pinho
Bruno Pinho

Reputation: 85

Filter a combobox value with the value of another combobox

Hello I'm looking for a way to filter values on a cell from a previous cell input... for example I have 3 tables, 1 with the BRANDS, another with MODELS and another with EQUIPMENT, and I want them to work like this, the BRANDS table, I want to put the brands of our equipment like this, Seat, Peugeot, VW, Audi and etc... the second table I will pull the brands from the first table and put the MODEL of the equipment, like [Seat; Ibiza][Seat;Leon][Peugeot;106][Peugeot;206] etc...

And its on the last one I have the question, I want to create the table with Brand, Model and another details, and when I select the brand I want only the models of that brand to appear on the Models combo box

Upvotes: 0

Views: 40

Answers (2)

Bruno Pinho
Bruno Pinho

Reputation: 85

Thanks to Andre because he said to me the keywords to look it up in google xD After I searched it I found this tutorial about it and I got it to work smoothly

https://www.youtube.com/watch?v=SpMyGlEInGs

Upvotes: 1

M.Hassan
M.Hassan

Reputation: 11032

FOR Tables:

 Brands (Seat, Peugeot, VW, Audi and etc)
 Models  ( [Seat; Ibiza][Seat;Leon][Peugeot;106][Peugeot;206] )
 Equipment

You can synchronize between combobox by using filter as given the following example:

For First Combbox cboBrands

 Me.cboBrands.RowSource = "SELECT ModelName FROM tblBrands ORDER BY ModelName "

For the second one cboModel which depend on the previous one cboModel, we filter data

Me.cboModel.RowSource ="SELECT  BrandName & ";" & ModelName  as Name" & _
                              "FROM  tblmodels "  & _
                              WHERE BrandName = " & _
                                   "Me.cboBrands " & _
                             " ORDER BY BrandName ,ModelName "

The same for equipment

Upvotes: 0

Related Questions