Vamos Lá
Insira:
TextBox = txtNome
ListBox = lstNome
Dim DelBack As Boolean
Dim ListClick As Boolean
Private Sub txtNome_Change()
Dim I As Integer
If ListClick Then
ListClick = False
Exit Sub
End If
Set TB = BD.OpenRecordset("SELECT Nome FROM Funcionários WHERE Nome LIKE '" & txtNome.Text & "*' ORDER BY Nome asc")
If (TB.RecordCount <> 0) Then
TB.MoveMax
TB.MoveMin
I = txtNome.SelStart
If (txtNome.Text <> "") And (Not DelBack) And (TB.RecordCount <> 0) Then txtNome.Text = TB!Nome
If (TB.RecordCount > 1) Then
lstNome.Visible = True
lstNome.Clear
While Not TB.EOF
lstNome.AddItem TB!Nome
TB.MoveNext
Wend
End If
txtNome.SelStart = I
txtNome.SelLength = Len(txtNome.Text)
End If
End Sub
Private Sub txtNome_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyDelete Or KeyCode = vbKeyBack Then
DelBack = True
Else
DelBack = False
End If
'DESCER
If (KeyCode = vbKeyDown) And (lstNome.Visible = True) Then
lstNome.SetFocus
End If
'DESCER
If (KeyCode = vbKeyReturn) Then
lstNome.Visible = False
cmdIncluir.SetFocus
End If
End Sub
Private Sub lstNome_Click()
ListClick = True
txtNome.Text = lstNome.List(lstNome.ListIndex)
Sel txtNome
End Sub
Private Sub lstNome_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = vbKeyReturn) Then
lstNome.Visible = False
txtNome.SetFocus
End If
End Sub
Public Sub Sel(objeto As TextBox)
objeto.SelStart = 0
objeto.SelLength = Len(objeto)
objeto.SetFocus
End Sub
Pra Colocar em Combo è Só Fazer Alguns Ajustes... Qualquer Coisa.. é So Contatar-me