
Originally Posted by
Ajax
Hi Ajax thank you! I used the the example in the link you provided. It worked almost perfectly. I created a macro on ENTER and EXIT events just as the example. For some reason, my table has some bugs and when change rows in the child column the value of the last selected row in the child column simply disappear.
I created 3 codes:
1- The first code erases the child ComboBox column, called "Categoria_2"selection
2- the second is a ENTER event where the list is filtered to show only the values based on the Master ComboBox column (cdo_categoria_1) selection.
3- The third code is a EXIT event to return the query that shows all records from the Child table.
Code:
Private Sub cdo_Categoria_2_Enter()
'MsgBox (cdo_Categoria_1)
cdo_Categoria_2.RowSource = "SELECT [tbl_Categoria2].[ID], [tbl_Categoria2].[Categoria_2], [tbl_Categoria2].[Categoria_1_2] FROM tbl_Categoria2 WHERE [categoria_1_2] = [cdo_Categoria_1] ORDER BY [Categoria_2] "
End Sub
Private Sub cdo_Categoria_2_Exit(Cancel As Integer)
cdo_Categoria_2.RowSource = "SELECT [tbl_Categoria2].[ID], [tbl_Categoria2].[Categoria_2] FROM tbl_Categoria2 ORDER BY [Categoria_2]"
End Sub
Private Sub cdo_Categoria_1_AfterUpdate()
cdo_Categoria_2 = ""
End Sub
so, when I change the comboBox from Categoria_2 column, the value of the last active row disappear. I went through all the example file but couldn't find any difference in the codes or Form specitication.
Pls help !!