Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    tab to next text field when 1st one is full (Access 97 (SP2))

    A user complaint has cropped up on an application where they are typing in a description on a text field and when they run out of room it, of course, beeps at them instead of continuing on the next line (like it "does" in Word). We can't put in a memo field due to the verbosity of some of the users and the fact that we use this data to fill in a word template form, where this text has a box restriction (form can only be 1 page).

    Is there any way to put code in that looks at what the user is typing in, and then when the selLength is, say, 100, focus on the textfield2? I've tried a few things but it either ignores the length and beeps, or errors out.

    <img src=/S/help.gif border=0 alt=help width=23 height=15>
    Carpy Diem, it&#39;s .

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: tab to next text field when 1st one is full (Access 97 (SP2))

    There's probably more to the issue, but the answer to you question is yes - sort of. You have to capture keystrokes and check the length each time someone enters a character. But I would approach it a different way - have the user enter text into an unbound textbox, and when they exit it, check the length, and if it's greater than 255 characters (the max in a text field) or whatever number you choose, then first warn them, and then if they insist do the split yourself. The Instr() function can be used to find a space character to break the text apart.

    I assume you are using automation to fill in the Word document - if it's done using a bookmark, you should be able to let your text grow some without blowing off the end of Page 1. Of course there's always the trick of reducing the font size as the amount of text goes up - 8pt TimesRoman is almost readable! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Wendell

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: tab to next text field when 1st one is full (Access 97 (SP2))

    Thanks, Wendell for the ideas.

    I think I'll try the unbound text box and checking the length. Unfortunately, reducing the font size on the form is not an option, as most users won't admit they need bifocals around here, if you know what I mean. And I'd hate to hear "this font's too <img src=/S/hmmn.gif border=0 alt=hmmn width=15 height=15> small!"

    I'll let you know how it goes.
    Carpy Diem, it&#39;s .

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: tab to next text field when 1st one is full (Access 97 (SP2))

    <hr> Unfortunately, reducing the font size on the form is not an option. . . <hr>
    I was going to adjust it based on the number of characters - e.g. <100 = 12 point, 100-150=10 point, 150-200=8 point, >200 = 6 point (barely readable with a magnifying glass) <img src=/S/sneaky.gif border=0 alt=sneaky width=15 height=15>
    Wendell

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: tab to next text field when 1st one is full (Access 97 (SP2))

    You can also test the length in the OnChange event of the control, which each time a character is typed in or deleted in a field. That would give them immediate feedback rather than allowing them to go overboard and then truncating the result.
    Charlotte

  6. #6
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: tab to next text field when 1st one is full (Access 97 (SP2))

    I had tried the OnChange to compare the number of characters with the character limit. I'll try this on an unbound text field and see if it works better. You would think when they got to the end of the white space on the field that it would give them a clue, but apparently it doesn't. <img src=/S/igiveup.gif border=0 alt=igiveup width=31 height=23>
    Carpy Diem, it&#39;s .

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: tab to next text field when 1st one is full (Access 97 (SP2))

    They probably aren't looking at the field while they're typing. OnChange should work on bound fields as well as unbound controls. If you're having problems with it, tell us specifically what they are. I've used this for the same purpose without problems.
    Charlotte

Posting Permissions

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