View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Curtis David Curtis is offline
external usenet poster
 
Posts: 1
Default Is this right? SetFocus weirdness

I have a userform which replaces an inputbox:

Function MyInputBox(caption, label)
UserForm1.TextBox1.SetFocus
UserForm1.TextBox1.Text = ""
UserForm1.caption = caption
UserForm1.Label1.caption = label
UserForm1.Show
MyInputBox = UserForm1.Value
End Function

On the build system (Excel2002/WinXP) the textbox receives the focus when
the form is shown, but on the user system (Excel2000/Win2K) when the form is
shown no control appears to have the focus. Is my code right?
Also, i found if on the user system I set the focus to button2 (last tab
orber) instead the form was shown correctly with the textbox having focus.

Any help would be appreciated.
Dave.