Dim ctrl As Control
Private Sub CommandButton1_Click()
If Not ctrl Is Nothing Then
ctrl = ''
ctrl.SetFocus
End If
End Sub
Private Sub TextBox1_Enter()
Set ctrl = TextBox1
End Sub
Private Sub TextBox2_Enter()
Set ctrl = TextBox2
End Sub
Private Sub TextBox3_Change()
Set ctrl = TextBox3
End Sub