Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Text Box on User Form Set Focus Issue

I have a form with some text boxes used to capture some
text input. After the input box is updated I test the
value in a Function called DataOwnerNameValid. If I fail
the validation test I give the user a message. I then want
to return the cursor to the Input box so the user can
reenter the data. To do this I use the following command:

DataOwnerForm.DataOwnerInputBox.SetFocus

But it doesn't work. The next input box or other control
on the form is selected. What is the right way to do this?

Thank you

Private Sub DataOwnerInputBox_AfterUpdate()
If DataOwnerForm.DataOwnerInputBox = "" Then Exit Sub
OwnerOK = DataOwnerNameValid
(DataOwnerForm.DataOwnerInputBox)
If OwnerOK = False Then
MsgBox "Not Valid Name", vbExclamation, "Data
Owner Name Invalid"
DataOwnerForm.DataOwnerInputBox.SetFocus
End If
End Sub
Reply
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
Highlight/Select text in User Form? Alan Smith Excel Discussion (Misc queries) 2 September 13th 07 09:02 PM
Adding a new text box to user form Marilyn Excel Discussion (Misc queries) 3 May 13th 07 11:42 PM
User Form: Cannot Update Text Box Charles in Iraq Excel Discussion (Misc queries) 0 October 12th 06 07:53 AM
How to set focus back to sheet after showing a user form Stephen Bullen Excel Programming 0 July 22nd 03 10:34 AM
How to set focus back to sheet after showing a user form Les[_4_] Excel Programming 0 July 21st 03 07:58 PM


All times are GMT +1. The time now is 10:39 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"