Re: Using LostFocus Instead of Valid

2013-01-31 Thread Frank Cazabon
Ken, there's a very easy way to get around the problem with the toolbar not receiving focus. I believe you merely reset focus to the current control. Frank. Frank Cazabon On 30/01/2013 09:24 PM, Ken Dibble wrote: Are there any other things that I have to watch for using this way of

RE: Using LostFocus Instead of Valid

2013-01-31 Thread Richard Kaye
...@leafe.com Subject: Re: Using LostFocus Instead of Valid That is the missing bit for my main problem. I rarely have occasion to use nodefault. In fact, it does not occur in my app at all. If I get this working, I suppose it will be making it debut. Next is bypassing the validation

Re: Using LostFocus Instead of Valid

2013-01-31 Thread Jean MAURICE
Back in the day, all we had was VALID and it was good... or not good... You could also return a numerical value : 0 was 'false', 1 go to the next control in the tab order, 2 two controls further -1 go to the previous control etc ... The Foxil

Re: Using LostFocus Instead of Valid

2013-01-31 Thread Ken Dibble
there's a very easy way to get around the problem with the toolbar not receiving focus. I believe you merely reset focus to the current control. I'm not sure what you're saying. Try this: Create a toolbar class with one command button on it. In that command button's Click() event method,

Re: Using LostFocus Instead of Valid

2013-01-31 Thread Frank Cazabon
I haven't time to set up the code you sent, but if I understand what you are trying to show, add one line of code to the start of the click method of the toolbar button, before your messagebox: _Screen.ActiveForm.ActiveControl.SetFocus() Frank. Frank Cazabon On 31/01/2013 01:42 PM, Ken

Re: Using LostFocus Instead of Valid

2013-01-31 Thread Ken Dibble
I haven't time to set up the code you sent, but if I understand what you are trying to show, add one line of code to the start of the click method of the toolbar button, before your messagebox: _Screen.ActiveForm.ActiveControl.SetFocus() That doesn't work. The control gets focus, then the

Re: Using LostFocus Instead of Valid

2013-01-31 Thread Frank Cazabon
Yes, I have all my validation in my business objects. I was just trying to show you that you can get around the problem of the toolbar buttons not getting focus and so the valid of a control with focus never running. The example probably wasn't very effective as I haven't had to do this in

Re: Using LostFocus Instead of Valid

2013-01-31 Thread Gene Wirchenko
At 10:09 2013-01-31, Ken Dibble krdib...@stny.rr.com wrote: I haven't time to set up the code you sent, but if I understand what you are trying to show, add one line of code to the start of the click method of the toolbar button, before your messagebox:

Re: Using LostFocus Instead of Valid

2013-01-31 Thread Dan Covill
On 01/31/13 10:09 AM, Ken Dibble wrote: Even if there was some way to make this work, it's a bad idea to tie validation code to the controls that display the data. If you need to handle the same data elsewhere, now you have to duplicate your validation code. I NEVER put the validation code in

Re: Using LostFocus Instead of Valid

2013-01-30 Thread Frank Cazabon
Hi Gene, to stop a control losing focus issue a NODEFAULT in the lostfocus. so you might have code like this: IF this.Value 0 NODEFAULT ENDIF I haven't done this in a long time so I may be inaccurate but that should at least set you on the right path Frank. Frank Cazabon On

Re: Using LostFocus Instead of Valid

2013-01-30 Thread Jean MAURICE
Hi Gene, The Valid method is here only to say I am allowed to leave the current object or not. As you have seen, you should not have another 'sequence' in it. Once Valid returns .T., the Lostfocus method is here to compute what to do when you leave the current object. I have never have

Re: Using LostFocus Instead of Valid

2013-01-30 Thread Gene Wirchenko
At 10:42 2013-01-30, Frank Cazabon frank.caza...@gmail.com wrote: to stop a control losing focus issue a NODEFAULT in the lostfocus. so you might have code like this: IF this.Value 0 NODEFAULT ENDIF I haven't done this in a long time so I may be inaccurate but that should at least set

Re: Using LostFocus Instead of Valid

2013-01-30 Thread Ken Dibble
Are there any other things that I have to watch for using this way of handling validation? (I am remembering now why I went with a button toolbar (to allow exiting a form when the current entry control has an invalid value), but there are probably other traps.) Toolbars and the