+ Reply to Thread
Results 1 to 10 of 10

Efficiency Question about formatting 20+ text boxes on a form

  1. #1
    Registered User
    Join Date
    03-25-2009
    Location
    San Jose
    MS-Off Ver
    Excel 2007
    Posts
    83

    Efficiency Question about formatting 20+ text boxes on a form

    Currently I'm using this:

    Please Login or Register  to view this content.
    But I have more than 20 of that type of entry box on the form...

    Since I need to do the "If Len(TextBox1.Value) >3" Check after the user inputs the data I can't think of a different way to do this.

    Additionally there is no guarantee that the user will even NEED to put anything in more than half the boxes.
    Last edited by D3Pratt; 03-31-2009 at 03:08 PM.

  2. #2
    Registered User
    Join Date
    03-25-2009
    Location
    San Jose
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Efficiency Question about formatting 20+ text boxes on a form

    I just realized I also need to include a value check for Numerical input only.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,570

    Re: Efficiency Question about formatting 20+ text boxes on a form

    Partial Sol'n:
    Please Login or Register  to view this content.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    03-25-2009
    Location
    San Jose
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Efficiency Question about formatting 20+ text boxes on a form

    Thanks for the reply.

    Looks like it would cut out a bit of code...

    ...but where do I plug that in?

    I tried to put it into the UserForm_Initialize(), it Kacked.


    I'm still more than a bit of a noob at this.

  5. #5
    Registered User
    Join Date
    03-25-2009
    Location
    San Jose
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Efficiency Question about formatting 20+ text boxes on a form

    It just occurred to me that what I need to do is a subroutine that I can call out from the "on exit" sub of the Text cells.

    Something like:

    Please Login or Register  to view this content.


    Or something like that.. I'll start playing with it.

  6. #6
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Efficiency Question about formatting 20+ text boxes on a form

    Yes, you are on the right track :-)

    I would change the CheckNum sub to a Function & then the code can be
    modified along the lines of...

    Please Login or Register  to view this content.
    From my brief testing, the use of the hash symbol appears to prevent the need for checking the length of the textbox string.

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  7. #7
    Registered User
    Join Date
    03-25-2009
    Location
    San Jose
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Efficiency Question about formatting 20+ text boxes on a form

    That works great!

    one thing tho, after entering a non Number the text that pops in stays there on focus so it can become an endless loop of adding text/numbers

    For my error checking I wanted to change the color of the box to a yellow for non numbers So I tried this:

    Please Login or Register  to view this content.
    Insta Kack.

    BTW you were right, The #,### worked perfectly as intended till I borked the code with the coloring thing.

  8. #8
    Registered User
    Join Date
    03-25-2009
    Location
    San Jose
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Efficiency Question about formatting 20+ text boxes on a form

    Still plugging away, tried this:

    Please Login or Register  to view this content.
    Still Insta Kack (might help if I actually read a book on this )

  9. #9
    Registered User
    Join Date
    03-25-2009
    Location
    San Jose
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Efficiency Question about formatting 20+ text boxes on a form

    Marking this thread as Solved since the original problem has been solved.

    Will start a new thread about the multiple conditioning.

    Thanks to broro183 and protonLeah for their help!

  10. #10
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Efficiency Question about formatting 20+ text boxes on a form

    Thanks for the feedback - I'm pleased we could help you to learn :-)

    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1