Combo box validation 
Author Message
 Combo box validation

I have a combo box where I want the user's selection to be validated.  Is
there a nice way to effectively do a limit to list, display an error
message, and end up having the focus in the text area of the combo box with
the entire text selected?  I've tried several different things: the click
event seems to be handled pretty easily, but LostFocus (for when the user
tabs out of the control) is causing some problems.  There seem to be more
GotFocus and LostFocus events then would appear to be necessary.  This
wouldn't seem to be too hard, but I keep ending up without the text selected
even after setting the SelStart and SelLength properties.

Thoughts?



Sat, 06 Dec 2003 05:12:16 GMT  
 Combo box validation
Hi Ed:

In your validation for the combo box before you
adjust the "sel" properties have you tried to give
the focus back to the combo box before
setting the sel properties? (Combo1.SetFocus)

Vincent Collura
(Inventor/Engineer)

http://www.CeBeans.com
Did you get your beans Today?

Quote:

>I have a combo box where I want the user's selection to be validated.  Is
>there a nice way to effectively do a limit to list, display an error
>message, and end up having the focus in the text area of the combo box with
>the entire text selected?  I've tried several different things: the click
>event seems to be handled pretty easily, but LostFocus (for when the user
>tabs out of the control) is causing some problems.  There seem to be more
>GotFocus and LostFocus events then would appear to be necessary.  This
>wouldn't seem to be too hard, but I keep ending up without the text
selected
>even after setting the SelStart and SelLength properties.

>Thoughts?



Sun, 07 Dec 2003 02:05:02 GMT  
 Combo box validation
Regarding the number of GotFocus() and LostFocus() events, you can look at
the following MSDN article for some insight:
http://support.microsoft.com/support/kb/articles/Q217/3/75.ASP#Event%...
s

I have the opposite problem -- I can't seem to generate a GotFocus() event
when I click in the text box portion of my combobox.  I want to
automatically drop down the list whenever the user clicks in the edit field,
but my code to do this (located inside the GotFocus event) never gets
executed.  I dunno.


Quote:
> I have a combo box where I want the user's selection to be validated.  Is
> there a nice way to effectively do a limit to list, display an error
> message, and end up having the focus in the text area of the combo box
with
> the entire text selected?  I've tried several different things: the click
> event seems to be handled pretty easily, but LostFocus (for when the user
> tabs out of the control) is causing some problems.  There seem to be more
> GotFocus and LostFocus events then would appear to be necessary.  This
> wouldn't seem to be too hard, but I keep ending up without the text
selected
> even after setting the SelStart and SelLength properties.

> Thoughts?



Sun, 07 Dec 2003 02:24:23 GMT  
 Combo box validation
Yes.  I actually tried to set the sel properties in the GotFocus event for
the combo box, too.


Quote:
> Hi Ed:

> In your validation for the combo box before you
> adjust the "sel" properties have you tried to give
> the focus back to the combo box before
> setting the sel properties? (Combo1.SetFocus)

> Vincent Collura
> (Inventor/Engineer)

> http://www.CeBeans.com
> Did you get your beans Today?


> >I have a combo box where I want the user's selection to be validated.  Is
> >there a nice way to effectively do a limit to list, display an error
> >message, and end up having the focus in the text area of the combo box
with
> >the entire text selected?  I've tried several different things: the click
> >event seems to be handled pretty easily, but LostFocus (for when the user
> >tabs out of the control) is causing some problems.  There seem to be more
> >GotFocus and LostFocus events then would appear to be necessary.  This
> >wouldn't seem to be too hard, but I keep ending up without the text
> selected
> >even after setting the SelStart and SelLength properties.

> >Thoughts?



Mon, 08 Dec 2003 02:24:42 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Data Validation and Combo Box Questions

2. Data Validation and Combo Box Questions

3. Data Validation and Combo Box Questions

4. have combo box result choose action/validation

5. enter data in a combo box based on value from another combo box

6. Limit subform combo box by selection in parent combo box

7. Want Access combo box to filter rowsource of another combo box

8. Populating a combo box from another combo box

9. Populate a combo box from another combo box selection

10. selecting records for 2nd combo box dependant on first combo box

11. Help filling second combo box from fist combo box

12. Combo box selection narrows next combo box choices

 

 
Powered by phpBB® Forum Software