|
-
Jan 17th, 2000, 12:38 PM
#1
Thread Starter
New Member
The validate event is not activated by either (a) using code (ie. SetFocus method) to set focus to another control or (b) pressing <enter> when there is a command button with its Default property set to TRUE.
I want to validate my textbox entry in both of these situations. Any suggestions?
Thanks.
-
Jan 17th, 2000, 01:06 PM
#2
Lively Member
This might not be the extact answer you are looking for but here goes.
Why don't you do the validate under the text box lost focus ?
-
Jan 17th, 2000, 04:23 PM
#3
Hyperactive Member
The validate event only occurs when the control that will receive the focus has the property CausesValidation set to true. At least, according to the helpfile... press F1 to find out...
And why not in the LostFocus? Sure, the lostfocus you can validate too, but if you wish to keep the focus on the control (not my favorite thing though) you better use the validate event. Setting focus in the lostfocus is not so smart.
-
Jan 17th, 2000, 09:09 PM
#4
Thread Starter
New Member
I do have the Causes Validation in my other controls set to TRUE. Also, I was trying to get away from doing validation in LOST FOCUS - partly because the control does not lose focus when you use the ENTER key to activate the default command button, and partly because the help file tells you its better to validate in VALIDATE not LOST FOCUS.
Validating in LOST FOCUS does solve the problem for using .SETFOCUS to move to another control but does not solve the problem for using the <ENTER> key.
-
Jan 17th, 2000, 09:30 PM
#5
Hyperactive Member
If everything else fails you can always use the keydown event, check the keycode to see if it's vbKeyReturn, and then do what you want.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|