LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop Excel's UPDATE\Don't UPDATE message box from appearing every time I open the work book divya Excel Programming 3 April 6th 13 03:31 PM
Data Validation lists update orginal cell with list update [email protected] Excel Worksheet Functions 3 July 11th 08 07:56 AM
Excel 2003 - Update or Don't Update Links Problem Jamie Excel Programming 4 July 7th 05 02:08 PM
Retrieve and update 1 record at a time Markantesp Excel Programming 2 March 7th 05 06:35 AM
retrieve and update data from a dbf file alfonso gonzales Excel Programming 0 October 2nd 04 11:57 PM


All times are GMT +1. The time now is 04:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"