cparralesl
Programmer
Hi everyone,
I have a datasheet sub form with a couple of combo boxes, one depending on the value of the other one. The mian combo box is unbounded, but it has a field on the table where to store the its value (DataSource control), and the other one takes its values from a table and depending on the value of the main combo box.
The problem I'm having is about refreshment, I think. I can see the whole list in the datasheet, with the values selected in the main combo box, but the dependant combo box does not shows nothing, it's empty. The datasource table of the dependant combo box has a field that refres to the main combo box too.
If the user select one option in the main combo box, the dependant combo box has to show certains groups of values and the use have to select one, and so on.
To solve that i used the following code at the AfterUpdate Event:
But it doesn't has the behavior i want. I wan to see in the DataSheet Sub Form the whole list with the values selected by the user in the unbound combo box and the dependendat one. And if the user add a new record or change the value of one that exists already always shows the values.
After use the code above, it refrsh som values, not the whole list of the datasheet. And when the form is open some values of the dependant combo box appears blank.
I really apprecite the help you can give me about it.
Regards,
Cesar Humberto Parrales
Application Support
I have a datasheet sub form with a couple of combo boxes, one depending on the value of the other one. The mian combo box is unbounded, but it has a field on the table where to store the its value (DataSource control), and the other one takes its values from a table and depending on the value of the main combo box.
The problem I'm having is about refreshment, I think. I can see the whole list in the datasheet, with the values selected in the main combo box, but the dependant combo box does not shows nothing, it's empty. The datasource table of the dependant combo box has a field that refres to the main combo box too.
If the user select one option in the main combo box, the dependant combo box has to show certains groups of values and the use have to select one, and so on.
To solve that i used the following code at the AfterUpdate Event:
Code:
Me.ID_ITEMSERVICIO = Null
Me.ID_ITEMSERVICIO.Requery
If (Me.ID_ITEMSERVICIO.ListIndex = -1) Or (Me.ID_ITEMSERVICIO.ListCount = 0) Then
Me.ID_ITEMSERVICIO = Me.ID_ITEMSERVICIO.ItemData(0)
Else
Me.ID_ITEMSERVICIO = Me.ID_ITEMSERVICIO.ItemsSelected(Me.ID_ITEMSERVICIO.ListIndex)
End If
But it doesn't has the behavior i want. I wan to see in the DataSheet Sub Form the whole list with the values selected by the user in the unbound combo box and the dependendat one. And if the user add a new record or change the value of one that exists already always shows the values.
After use the code above, it refrsh som values, not the whole list of the datasheet. And when the form is open some values of the dependant combo box appears blank.
I really apprecite the help you can give me about it.
Regards,
Cesar Humberto Parrales
Application Support