Visual Basic - Busqueda de registro

Life is soft - evento anual de software empresarial
 
Vista:

Busqueda de registro

Publicado por Rosy (1 intervención) el 19/10/2009 03:11:16
Hola, estoy empezando a programar con vb y agradezco kien pueda ayudarme con mi duda, estoy realizando un sistema de busquedas, pero no logro dar con el codigo para limitar la busqueda, es dcir q cuando el usuario ingrese un codigo el programa lo ubique y muestre la informacion dl mismo a través d unos text box... D ante mano gracias por la colaboracion...
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Busqueda de registro

Publicado por juan carlos (518 intervenciones) el 19/10/2009 03:26:23
Hola Rosy aqui tienes este codigo para buscar en una table
si quieres el programa completo para ver su funcionamiento
mi mail es:
[email protected]
============================
Private Sub Text1_Change()
If InStr(Text1.Text, Chr(13)) <> 0 Then
Text1.Text = Mid(Text1.Text, InStr(Text1.Text, Chr(13)) + 2, Len(Text1.Text))
End If
If InStr(Text1.Text, Chr(9)) <> 0 Then
Text1.Text = Mid(Text1.Text, InStr(Text1.Text, Chr(9)) + 2, Len(Text1.Text))
End If
List1.Clear
If Tabla1.RecordCount > 0 Then
Tabla1.MoveFirst
cont = 0
Do While Not Tabla1.EOF
compa (Tabla1!nombre)
If ok = True Then
cont = cont + 1
List1.AddItem cont & ")" & Chr(9) & Tabla1!nombre
End If
Tabla1.MoveNext
Loop
If List1.ListCount > 0 Then: List1.Selected(0) = True
End If
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

If (KeyCode = 13) And (List1.ListCount > 0) Then
List1_dblClick
Text1.Text = ""
End If
If (KeyCode = 13) And (List1.ListCount = 0) Then
Form1.Hide
Call add
Text1.Text = ""
End If
If KeyCode = 40 And List1.ListCount > 1 And List1.ListIndex < List1.ListCount - 1 Then
List1.Selected(List1.ListIndex) = False
List1.Selected(List1.ListIndex + 1) = True
End If
If KeyCode = 38 And List1.ListCount > 1 And List1.ListIndex > 0 Then
List1.Selected(List1.ListIndex) = False
List1.Selected(List1.ListIndex - 1) = True
End If
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar