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