Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setfocus after a msgbox


Hello,
I have a userform where i validate if the text entered can be formatte
to a number (double). When the check is false, a msgbox pops up sayin
"text entered is a number." [retry] [cancel]

If Not IsNumeric(wtStr) Then
If MsgBox(wtStr & " is not a weight value.", 5) = vbRetry Then
Me.BoxWeightTextBox.Text = ""
Me.BoxWeightTextBox.SetFocus
End If
End If

This is the code fragment. I expected the focus to go back text box
but instead shifts to the next tabstop.

Am I doing something wrong? or is this a newbie mistake? HELP!!

Thanks in advance

--
simpleMo
-----------------------------------------------------------------------
simpleMod's Profile: http://www.excelforum.com/member.php...fo&userid=1572
View this thread: http://www.excelforum.com/showthread.php?threadid=27245

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default setfocus after a msgbox

It works for me if I have that code in a button click event.

Where are you calling it from?

--

HTH

RP

"simpleMod" wrote in message
...

Hello,
I have a userform where i validate if the text entered can be formatted
to a number (double). When the check is false, a msgbox pops up saying
"text entered is a number." [retry] [cancel]

If Not IsNumeric(wtStr) Then
If MsgBox(wtStr & " is not a weight value.", 5) = vbRetry Then
Me.BoxWeightTextBox.Text = ""
Me.BoxWeightTextBox.SetFocus
End If
End If

This is the code fragment. I expected the focus to go back text box
but instead shifts to the next tabstop.

Am I doing something wrong? or is this a newbie mistake? HELP!!

Thanks in advance.


--
simpleMod
------------------------------------------------------------------------
simpleMod's Profile:

http://www.excelforum.com/member.php...o&userid=15724
View this thread: http://www.excelforum.com/showthread...hreadid=272454



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
SetFocus Problem Todd Huttenstine[_2_] Excel Programming 2 January 19th 04 10:50 PM
SetFocus using variable name Taras Excel Programming 2 December 4th 03 10:11 PM
SetFocus using variable name Bob Phillips[_6_] Excel Programming 0 December 4th 03 09:47 PM
SetFocus problem RFraley Excel Programming 2 September 7th 03 01:18 PM
TextBox.SetFocus steve Excel Programming 4 July 16th 03 07:40 PM


All times are GMT +1. The time now is 01:04 PM.

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"