> The problem that I have is that when these functions return, the focus
> goes back to the first form. gotfocus fires a second time. I do not
> want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...
Regards
-Stefan
"Gene Wirchenko" <genew@[EMAIL PROTECTED]
> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0@[EMAIL PROTECTED]
> I have one form in my app which is used to control invoicing. It
> has a number of functions that are internal and some that are
> external. These functions are started by the operator clicking a
> button. The form also has some data about the current client. Some
> of this data can be changed. It should be saved before doing
> something. With most buttons -- the exceptions are unim****tant -- the
> gotfocus of the button contains code to save the client data. The
> valid contains the code to run.
>
> In the case of the external functions, other forms are created.
> The problem that I have is that when these functions return, the focus
> goes back to the first form. gotfocus fires a second time. I do not
> want it to, or I want to avoid the save.
>
> I think I have a solution. I can set a status flag in the
> valid's code which the save routine will check to determine whether it
> should save. At the end, the save routine would reset this flag. This
> seems somewhat convoluted.
>
> Is there something I am missing, or is this the way to go?
>
> Sincerely,
>
> Gene Wirchenko
>
> Computerese Irregular Verb Conjugation:
> I have preferences.
> You have biases.
> He/She has prejudices.
>


|