SoloCodigo
Programación General => Visual Basic 6.0 e inferiores => Mensaje iniciado por: Jorge López en Miércoles 22 de Enero de 2003, 18:26
-
HOLA A TODOS..
TENGO UN COMBOBOX QUE DESPLIEGA LOS REGISTROS DEL CAMPO NOMBRE DE UNA TABLA, COMO HAGO PARA QUE CUANDO SELECCIONE UN NOMBRE, SE MUESTRE EN EL TEXTBOXCARGO, EL CARGO ALMACENADO PARA ESE NOMBRE SELECCIONADO EN EL COMBO, Y EN EL TEXTBOXHORARIO EL HORARIO PARA ESA PERSONA
-
Private Sub combobox_clicl()
Dim rsValores As New Adodb.RecordSet, strSql as String
strSql = "SELECT * FROM TABLA WHERE NAME LIKE '" & combobox.text & "'"
rsValores.Open strSql, cadena_conexion_bd, 3, 1
If Not rsValores.EOF Then
textboxcargo.text = rsValores("CARGO")
textboxhorario.text=rsValores("HORARIO")
End If
rsValores.close
Set rsValores = Nothing
End Sub
Espero que te sirva.
Saludos,
Roberto García