Posts by ShosMeister

    Re: set Focus Back To Control

    This isn't all of the code attached to the form but should be enough for you to get an idea. If not, I can load more:

    The txt_Scorexx_Change is the code attached to the text boxes. Again, there are a total of 36 of these on the form.

    Thanks for offering to help!

    Re: set Focus Back To Control

    Hey SuperDave :)

    I was searching for a similar problem and I think your sollution is what I probably need, but (you were waiting).....

    I have 36 text boxes on the form. I could not find any way of having one function to handle all of them so I made a separate function and just made the _chage event for each of the 36 txt controls call that function. No problems at this point.

    In the main function, I do some simple validation and minor work. If the user entered an invalid value (in this case all of the txt fields must be numeric and single digit), I clear out the control and setfocus back to it.

    The problem is that when I run it in debug mode, all works well. When I run it normally, the text field is cleared but the focus will not go back to that text field - since it is max_length=1, it goes to the next field. Any ideas?