i have two comboboxes, i want to change the values of one combobox when the user selects a value in the other one but i'm not sure how to do that, i'm trying with subforms without good results, here's what i'm doing
let's say i have three tables: categories, products and models, the records they store behave like a three, i mean, each model is related to a product and each product related to a category, this may be resumed like this:
fields: id, name, dependencie
i want to show the categories in a combobox and when i select a value in that combo populate the 2nd combo with the corresponding products, and do the exact same thing after select a value in the products combo: populate the models combo with the models that correspond to the product selected.
after that the user would choose a value from the models combo and a subform would show the specific info for that product/model
i'm trying to do this with nested subforms but i haven't found how to relate one to another, and i'm not sure this is the best way
could you tell me what is the best way to accomplish this??
first of all thanks for your help, you solved my problem, now i just need to know how to show the column with the names instead of the one with the keys, i used a query like "select table.key, table.name from ..." and only the 'key' column is displayed, i have read the help and it says there is a TextColumn property that will set the column that contains the text to be shown, however when i run the code i got a 'member not found' error in the TextColumn line, this happens with both listbox and combobox
here is the relevant code:
Private Sub categoriasCombo_Change()
Dim sqlstr As String
sqlstr = "select articulos.clave,articulos.nombre from articulos where articulos.categoria=categoriasCombo.value"
articulosCombo.RowSource = sqlstr
articulosCombo.BoundColumn = 1
articulosCombo.TextColumn = 2 'error here
currently the listbox/combobox only shows the 'clave' column, how can i set it to show the 'nombre' column??
thanks for your help