Validating/Validated questions 
Author Message
 Validating/Validated questions

Trap for the key press and handle it appropriately.


Quote:
> I have a class called cMyIntegerBox. It allows the setting of a minimum
> value and a maximum value. I also have a class cICLocnCode which inherits
> cMyIntegerBox and in the Sub New() it sets the minimum value to 1.

> cMyIntegerBox has a Private Sub to handle mybase.validating which checks
to
> make sure a number was entered and that it is greater then the minimum
> value.

> Likewise, cICLocnCode has a Private Sub which verifies the location exists
> in the database.

> My problem is on a form I use the ESC key to exit the form (cancelbutton
is
> set). If I am on a field tied to cICLocnCode and hit the ESC key, it does
> the validating for cMyIntegerBox and fails because the entered value is
> blank, which is less then 1.

> My question is I would like (I think) a way that if the ESC key is hit to
> NOT do any validating routines. Any ideas how to do this, or is there a
> better way to do what I am trying to do.

> TIA



Tue, 26 Apr 2005 22:51:22 GMT  
 Validating/Validated questions
That would handle the ESC key, but what about the Cancel button?

Also, I would prefer this to be in one location, like in the class
validating routines or something like that.



Quote:
> Trap for the key press and handle it appropriately.



> > I have a class called cMyIntegerBox. It allows the setting of a minimum
> > value and a maximum value. I also have a class cICLocnCode which
inherits
> > cMyIntegerBox and in the Sub New() it sets the minimum value to 1.

> > cMyIntegerBox has a Private Sub to handle mybase.validating which checks
> to
> > make sure a number was entered and that it is greater then the minimum
> > value.

> > Likewise, cICLocnCode has a Private Sub which verifies the location
exists
> > in the database.

> > My problem is on a form I use the ESC key to exit the form (cancelbutton
> is
> > set). If I am on a field tied to cICLocnCode and hit the ESC key, it
does
> > the validating for cMyIntegerBox and fails because the entered value is
> > blank, which is less then 1.

> > My question is I would like (I think) a way that if the ESC key is hit
to
> > NOT do any validating routines. Any ideas how to do this, or is there a
> > better way to do what I am trying to do.

> > TIA



Tue, 26 Apr 2005 22:53:45 GMT  
 Validating/Validated questions
I have a class called cMyIntegerBox. It allows the setting of a minimum
value and a maximum value. I also have a class cICLocnCode which inherits
cMyIntegerBox and in the Sub New() it sets the minimum value to 1.

cMyIntegerBox has a Private Sub to handle mybase.validating which checks to
make sure a number was entered and that it is greater then the minimum
value.

Likewise, cICLocnCode has a Private Sub which verifies the location exists
in the database.

My problem is on a form I use the ESC key to exit the form (cancelbutton is
set). If I am on a field tied to cICLocnCode and hit the ESC key, it does
the validating for cMyIntegerBox and fails because the entered value is
blank, which is less then 1.

My question is I would like (I think) a way that if the ESC key is hit to
NOT do any validating routines. Any ideas how to do this, or is there a
better way to do what I am trying to do.

TIA



Tue, 26 Apr 2005 22:32:44 GMT  
 Validating/Validated questions
Try a test in the lostfocus event.  That will fire every time.


Quote:
> Trap for the key press and handle it appropriately.



> > I have a class called cMyIntegerBox. It allows the setting of a minimum
> > value and a maximum value. I also have a class cICLocnCode which inherits
> > cMyIntegerBox and in the Sub New() it sets the minimum value to 1.

> > cMyIntegerBox has a Private Sub to handle mybase.validating which checks
>  to
> > make sure a number was entered and that it is greater then the minimum
> > value.

> > Likewise, cICLocnCode has a Private Sub which verifies the location exists
> > in the database.

> > My problem is on a form I use the ESC key to exit the form (cancelbutton
>  is
> > set). If I am on a field tied to cICLocnCode and hit the ESC key, it does
> > the validating for cMyIntegerBox and fails because the entered value is
> > blank, which is less then 1.

> > My question is I would like (I think) a way that if the ESC key is hit to
> > NOT do any validating routines. Any ideas how to do this, or is there a
> > better way to do what I am trying to do.

> > TIA



Wed, 27 Apr 2005 06:48:37 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to validate text box contents in validating event as well as assignment

2. Form's validate does not fire usercontrol(inside textbox) validating event

3. Validating, Validated, LostFocus Event Order

4. will vbscript validate over ride webbot validate?

5. Validating a form question

6. question about validating user input

7. Simply question about lostfocus, textbox and validate data!

8. Newbie Question: Validate extension of upload file

9. textbox validate event question

10. DataRepeater validate question

11. DataRepeater validate question

12. DataRepeater validate question

 

 
Powered by phpBB® Forum Software