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: 2
Default UserForm1.Textbox1.SetFocus Question

I have created a program in Excel 2000, which is used on a Windows 98,
Windows 2000 and Windows XP (Home Addition) platform. My problem is
the same on all platforms. The program contains 10 UserForms that
contain numerous Textboxes, comboboxes, listboxes, etc. Information is
entered into the textboxes and eventually transferred to forms for
printing, and a spreadsheet is used to maintain historical records.
Information fed into some of the textboxes is validated prior to the
user being able to continue to the next stage. When the user clicks
CommandButton1 the UserForm is hidden and the data entered validated.
If the data entered is invalid a MsgBox appears with a message
advising the user, who must then click the OK button to continue.
Upon clicking the OK button the unacceptable data that has been
entered in the textbox is erased and the UserForm re-appears so that
the user can enter the correct data. My problem is that I cannot get
the SETFOCUS command to activate the textbox when the UserForm
re-appears.

For example the Userform10 Code contains:

Private Sub commandbutton2_Click()
UserForm10.Hide
UserForm10.TextBox1.SetFocus
UserForm1.Show
End Sub

The UserForm1 Code contains:

Private Sub Commandbutton4_Click()
UserForm1.Hide
UserForm10.Show
UserForm10.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
SetFocus on a different sheet in VBA AaronC Excel Discussion (Misc queries) 1 June 9th 05 11:18 PM
Userform1 Border Tom Ogilvy Excel Programming 1 August 13th 03 03:14 PM
Userform1 Border John Wilson Excel Programming 0 August 12th 03 04:08 PM
SetFocus method in VBA Robin S. Excel Programming 2 July 16th 03 10:20 PM


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