sub command1_click()
if len(text1)>3 then
text1=right(text1,len(text1)-3)
endif
end sub
Private Sub Text1_Click()
miForm!StatusBar1.Panels("Posic").Text = " Pos: " & Text1.SelStart + 1 _
& "/" & Text1.MaxLength
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
miForm!StatusBar1.Panels("Posic").Text = " Pos: " & Text1.SelStart + 1 _
& "/" & Text1.MaxLength
End Sub
Private Sub Combo1_Change(Index As Integer)
Static YaEstoy As Boolean
On Local Error Resume Next
If Not YaEstoy Then
YaEstoy = True
unCombo_Change Combo1(Index).Text, Combo1(Index)
YaEstoy = False
End If
Err = 0
End Sub
Private Sub Combo1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
unCombo_KeyDown KeyCode
End Sub
Private Sub Combo1_KeyPress(Index As Integer, KeyAscii As Integer)
unCombo_KeyPress KeyAscii
End Sub
Añade estas declaraciones y procedimientos en un módulo BAS,
(o en el mismo FORM, pero cambia el PUBLIC por PRIVATE):
Option Explicit
Dim Combo1Borrado As Boolean
Public Sub unCombo_KeyDown(KeyCode As Integer)
If KeyCode = vbKeyDelete Then
Combo1Borrado = True
Else
Combo1Borrado = False
End If
End Sub
Public Sub unCombo_KeyPress(KeyAscii As Integer)
'si se pulsa Borrar... ignorar la búsqueda al cambiar
If KeyAscii = vbKeyBack Then
Combo1Borrado = True
Else
Combo1Borrado = False
End If
End Sub
Public Sub unCombo_Change(ByVal sText As String, elCombo As ComboBox)
Dim i As Integer, L As Integer
If Not Combo1Borrado Then
L = Len(sText)
With elCombo
For i = 0 To .ListCount - 1
If StrComp(sText, Left$(.List(i), L), 1) = 0 Then
.ListIndex = i
.Text = .List(.ListIndex)
.SelStart = L
.SelLength = Len(.Text) - .SelStart
Exit For
End If
Next
End With
End If
End Sub
Jejejejeje con este lo que pasara es que cuando escribas algo te detecta automaticamente si ya has escrito antes eso para hacer mas facil todo ademas de seleccionar todo el texto espero te sirva de algo