Ver Mensaje Individual
  #7 (permalink)  
Antiguo 12/02/2009, 16:32
Avatar de fedefrankk
fedefrankk
 
Fecha de Ingreso: agosto-2007
Mensajes: 871
Antigüedad: 17 años, 9 meses
Puntos: 7
Pregunta Respuesta: Como pasar los datos de un list a un text

Hola Avellaneda, hice lo que me dijiste, cada ves que en list box aparece un nombre y hago un clik se repite en todos los text... voy a dejar como lo hice antes que vos me enseñaste a hacerlo.. con el FLesGrid,,,, solamente me queda un problema por resolver... (va varios jajaja).. pero voy por partes

Cada ves que busco el titulo del flex grid se me va hacia abajo y no se queda en su lugar... te muestro el codigo y una imagen

codigo del text que busca:

Código PHP:
Private Sub Text2_Change()
Call abrir
de 
"Select count(*) as ultimo from contactos"
apertura.Open deconectar
ultimo 
apertura!ultimo 1
apertura
.Close
    MSFlexGrid1
.FixedCols 0
    MSFlexGrid1
.Cols 8
    MSFlexGrid1
.FixedRows 0
    MSFlexGrid1
.Rows ultimo
    MSFlexGrid1
.ColWidth(0) = 1801
    MSFlexGrid1
.ColWidth(1) = 1301
    MSFlexGrid1
.ColWidth(2) = 1301
    MSFlexGrid1
.ColWidth(3) = 1101
    MSFlexGrid1
.ColWidth(4) = 1312
    MSFlexGrid1
.Font 8
    MSFlexGrid1
.TextMatrix(00) = "NOMBRE y APELLIDO"
    
MSFlexGrid1.TextMatrix(01) = "TEL PERSONAL"
    'On Error Resume Next
    MSFlexGrid1.TextMatrix(0, 2) = "TEL COMERCIAL "
    MSFlexGrid1.TextMatrix(0, 3) = "CELULAR"
    MSFlexGrid1.TextMatrix(0, 4) = "E-MAIL"
   MSFlexGrid1.TextMatrix(0, 5) = ""
     MSFlexGrid1.TextMatrix(0, 6) = ""
    MSFlexGrid1.TextMatrix(0, 7) = ""
    Call cerrar
apertura.CursorLocation = adUseClient
If Text2 = "" Or IsNumeric(Text2) = True Then
Text2 = ""
Text2.SetFocus
MSFlexGrid1.Clear
Else
Call abrir

x = "Select * from contactos where nombre_apellido like '" & Text2.Text & "
%'"
apertura.Open x, conectar
MSFlexGrid1.Rows = apertura.RecordCount + 1
MSFlexGrid1.Sort = flexSortStringNoCaseAscending
i = 0
Do While Not apertura.EOF
    With MSFlexGrid1
        .TextMatrix(i, 0) = apertura!nombre_apellido
        .TextMatrix(i, 1) = apertura!domicilio
        .TextMatrix(i, 2) = apertura!tel_personal
         '
On Error Resume Next
        
.TextMatrix(i3) = apertura!tel_comercial ""
        
.TextMatrix(i4) = apertura!email ""
        
.TextMatrix(i5) = apertura!cel ""
        
.TextMatrix(i6) = apertura!comentarios ""
    
End With
 i 
1
    apertura
.MoveNext
Loop
    Call cerrar
    End 
If
End Sub 
ese codigo tambien configura el MSFlexGrid1

el codigo para que cuando hago click en el MSFlexGrid1 se vallan los datos a los text es el siguiente (que me lo pasaste vos)

Código PHP:
Dim i As Integer
For 0 To Text1.UBound
Text1
(i).Text MSFlexGrid1.TextMatrix(MSFlexGrid1.Rowi)
Next i 

aca dejo la imagen que sale el error de los titulos

gracias a todos y SALUDOS