Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ComboBox and Set Focus


Hi,

Thanks for the help for my SQL question!!!

I have two more questions

(The application is Excel VBA. All controls are in a user form)

1. For ComboBox, how can I prevent users from entering any value other
than those in the listed choices in the ComboBox? User can only select
the value from the list.

2. There are several Text Boxes in my application. Users need to enter
numeric data in these boxes. The function required is if users enter any
character, e.g. 300k, there will be an error message and the focus
should fix in that TextBox (users can't move from this box to other
controls until they enter a valid value).

Thanks

Ming



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ComboBox and Set Focus

You can set matchrequired property so that they can only
pick from the list.

You could use the keyup event to check the character just
entered to display a msgbox with an error message and
then delete the last character entered. Probabley easier
to check the text when they leave the box (less overhead)
and then set focus back to the control they just left.
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
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
set focus tkaplan Excel Discussion (Misc queries) 3 September 27th 05 07:41 PM
Set Focus gregork Excel Programming 2 March 7th 04 05:29 AM
How do I set focus Newbie Excel Programming 2 February 11th 04 07:03 PM
Focus on combobox atkscott Excel Programming 4 November 20th 03 12:36 AM


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