Yo lo hago asi, en el evento click del combo1:
Código:
ConectarSQLServer SERVER_NAME, DB_NAME
SEL_ITEM = cbo_combo1.ItemData(combo1.ListIndex)
Call FillCombo2 SEL_ITEM
Set cmd.ActiveConnection = Nothing
DesconectarSQLServer
Para llenar el segundo combo:
Código:
Private Sub FillCombo2(ItemSeleccionado As Integer)
Set cmd = New ADODB.Command
cmd.ActiveConnection = conn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "sp_get_lista"
cmd.Parameters(1).Value = ItemSeleccionado
Set rtmp1 = cmd.Execute
If rtmp1.BOF And rtmp1.EOF Then
MsgBox Mensaje, vbInformation, TITULO
Exit Sub
End If
idx = -1
combo2.Clear
rtmp1.MoveFirst
While Not rtmp1.EOF
combo2.AddItem rtmp1("TEXTO")
rtmp1.MoveNext
Wend
rtmp1.Close
Set rtmp1 = Nothing
End Sub