ComboBox llena TextBox
Publicado por Albert (88 intervenciones) el 08/12/2008 13:43:02
Buenos dias foreros, tengo un codigo que abre un combobox y una vez has escogido rellena un textBox con los datos que tocan, me funciona a la perfección en un USF que hice hace un tiempo, ahora intento copiarlo en un USF multipage y no entiendo que estoy haciendo mal por que me funciona el ComboBox pero no me rellena el TextBox.
Os adjunto el codigo por si alguien puede perder el tiempo en revisarlo.
Mil gracias de antemano.
Private Sub ComboBox1_Enter()
Dim i As Double
Dim final As Double
Dim tareas As String
ComboBox1.BackColor = &H80000005
For i = 1 To ComboBox1.ListCount
'Remove an item from the ListBox.
ComboBox1.RemoveItem 0
Next i
For i = 4 To 10000
If datos.Cells(i, 2) = "" Then
final = i - 1
Exit For
End If
Next
For i = 4 To final
tareas = datos.Cells(i, 2)
ComboBox1.AddItem (tareas)
Next
End Sub
Private Sub ComboBox1_Click()
Dim i As Integer
Dim final As Integer
For i = 4 To 10000
If datos.Cells(i, 2) = "" Then
final = i - 1
Exit For
End If
Next
For i = 4 To final
If Val(ComboBox1) = datos.Cells(i, 2) Then
TextBox1 = datos.Cells(i, 3)
Exit For
End If
Next
End Sub
Os adjunto el codigo por si alguien puede perder el tiempo en revisarlo.
Mil gracias de antemano.
Private Sub ComboBox1_Enter()
Dim i As Double
Dim final As Double
Dim tareas As String
ComboBox1.BackColor = &H80000005
For i = 1 To ComboBox1.ListCount
'Remove an item from the ListBox.
ComboBox1.RemoveItem 0
Next i
For i = 4 To 10000
If datos.Cells(i, 2) = "" Then
final = i - 1
Exit For
End If
Next
For i = 4 To final
tareas = datos.Cells(i, 2)
ComboBox1.AddItem (tareas)
Next
End Sub
Private Sub ComboBox1_Click()
Dim i As Integer
Dim final As Integer
For i = 4 To 10000
If datos.Cells(i, 2) = "" Then
final = i - 1
Exit For
End If
Next
For i = 4 To final
If Val(ComboBox1) = datos.Cells(i, 2) Then
TextBox1 = datos.Cells(i, 3)
Exit For
End If
Next
End Sub
Valora esta pregunta


0