Multiple textbox validation & tab order

  • Hello. I have a form with around 50 textboxes.


    Firstly, is there a quick way to set the tab order so that it is automatically in sequence, rather than having to go through each one manually?


    Secondly, is there a quick way to validate all 50 in one go? I want to ensure that only numbers 0-9 are entered in each textbox. Previously, I've used a validation script on a single textbox using KeyPress & Ascii codes 48-57, but I don't know if this can be adapted for multiple textboxes.


    Thanks in anticipation.


    Stephen

  • Re: Multiple textbox validation & tab order


    norie,
    Apologies for reviving this long after it's probably slipped from your mind but I am having trouble understanding your attachment. I've just tried to get it to work on my form, exactly as it stands, but nothing happens. There's no error, but it doesn't stop me from entering non-numeric data. Any idea why this might be?
    Help from anyone at all welcome of course. Thanks. The code is as follows:



    Class Module


  • Re: Multiple textbox validation & tab order


    Stephen


    In my example you'll notice that this isn't in a sub.

    Code
    Dim TextBoxes() As New CTextboxes


    Useform module.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!