Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) KeySelectAll = False If KeyCode = vbKeyA And Shift = vbCtrlMask Then If TypeOf Me.ActiveControl Is TextBox Then Me.ActiveControl.SelStart = 0 Me.ActiveControl.SelLength = Len(Me.ActiveControl.Text) KeySelectAll = True End If End If End Sub
Private Sub Form_KeyPress(KeyAscii As Integer) If KeySelectAll Then KeyAscii = 0 End If End Sub
Private Sub Form_Load() Me.KeyPreview = True End Sub