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: 1
Default Textbox highlighting issue


I have a number of textboxes on a userform. When the user enters dat
beyond accepted paramaters,

1. an error message is generated
2. the form 'close' button is locked (& changes color)
3. the offending input textbox changes color.

I also would like the cursor to return to the offending textbox afte
step 3 - how do I do this ? (apologies for what must be a basi
problem).

Here is a sample of the code I am using:

Private Sub EnterInfo_Click()

If txtStaff.Text = "" Then
MsgBox "Please enter number of staff", 64, "Error Message"
CloseButton.Locked = True
CloseButton.BackColor = &H80000013
txtStaff.BackColor = &H80000013

Else
If txtStaff = 0 Then
CloseButton.Locked = False
CloseButton.BackColor = &H80000010
txtStaff.BackColor = &H80000005


Any help much appreciated

Cheers

Peter (new to VBA

--
peter.thompso
-----------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...fo&userid=2968
View this thread: http://www.excelforum.com/showthread.php?threadid=49624

 
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
Excel highlighting issue joe Mitchell Excel Discussion (Misc queries) 2 September 8th 06 03:12 PM
highlighting the text of a textbox hawk Excel Programming 1 April 16th 04 07:16 PM
Highlighting text in a textbox Daniel Bonallack[_2_] Excel Programming 3 December 29th 03 07:08 PM
Highlighting Textbox Garry Jones Excel Programming 1 October 9th 03 06:36 PM
Highlighting or Selecting TextBox entry Gus Gazepis Excel Programming 3 September 8th 03 12:01 AM


All times are GMT +1. The time now is 02:14 PM.

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"