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: 175
Default TextBox1.SetFocus not responding

This is probably something too simple....

As you can see below, I have put this line of code everywhere I can
think of. But, TextBox2 still comes up active. I even tried
UserForm4.TextBox1.SetFocus with no better results. Can anyone spot my
obvious error???
Thanks,
J.O.


Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'This will check to make sure the PO# the user entered is not already
on
'the list. If so, message box comes up.

With Worksheets("Official list")

'TextBox1.SetFocus

If TextBox1.Text < "" And Not .Range("j:j").Find(TextBox1.Text,
LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False) Is Nothing Then
MsgBox "This PO/PL is already on the list. Please enter the
information in the existing Record."

'This will clear all testboxes
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
ctl.Text = ""
'TextBox1.SetFocus

End If
Next ctl

'TextBox1.SetFocus

End If
End With

'TextBox1.SetFocus


End Sub

 
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
TextBox1 to Label4 damorrison Excel Discussion (Misc queries) 5 March 12th 06 04:05 PM
Make textbox1.value default Dr.Schwartz Excel Programming 2 October 17th 05 01:51 PM
alternative to TextBox1.Activate jose luis Excel Programming 1 June 4th 05 02:48 AM
x = textbox1.value (somethings wrong) CAA[_18_] Excel Programming 6 March 5th 04 03:24 PM
UserForm1.Textbox1.SetFocus Question Zane Greer Excel Programming 1 September 14th 03 11:59 AM


All times are GMT +1. The time now is 03:01 AM.

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

About Us

"It's about Microsoft Excel"