View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
LuisE LuisE is offline
external usenet poster
 
Posts: 133
Default Retrieve focus After Update

How can I set the focus back to the control after "After Update" validation?
Thanks in advance.

If Not IsNumeric(TxtPhone.Value) And TxtPhone.Value < vbNullString Then
MsgBox "Sorry, only numbers allowed"
TxtPhone.Value = vbNullString
TxtPhone.SetFocus
End If

If Len(TxtPhone.Value) < 10 Then
MsgBox "Please enter the phone number including area code"
TxtPhone.Value = vbNullString
TxtPhone.SetFocus
Exit Sub
Else
TxtPhone.Value = Format(TxtPhone.Value, "(###) ###-####")
End If