Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Form Field (2000)

    I am setting up a form where each line has to have specific text and line numbers at the beginning of the line and after this default text, there can only be up to 78 characters of text in the form field. Is it possible to have the field automatically break at a word and move to the next field when the maximum is reached? I suppose I could do it with a macro on entry that waits until the 78 character limit is reached and takes the last word and move it to the next field. However, that will take me a while to figure out the programming for that without some direction.

    If after reviewing the sample anyone has any better suggestions, let me know!

    FYI, this is for a quick and dirty HL7 interface...
    Attached Files Attached Files

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Field (2000)

    Have a look at the thread starting with <post#=320292>post 320292</post#>.

    Alan

  3. #3
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Form Field (2000)

    Thanks Alan. I'm really most interested in whether I can have the field automatically move to the next field when the character limit is reached. I had no problem setting it for 78 characters.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Form Field (2000)

    I don't know if any way to monitor keystrokes inside a FormField. (There is an application event named something like WindowSelectionChange, but it isn't super reliable.) If you don't want to use a UserForm, I think the easiest way would be to create a big multiline textbox (formatted as hidden so it doesn't print), have the user type everything in there, and then use an Exit macro on that field to lay it out in your other FormFields.

  5. #5
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Form Field (2000)

    By the time you've done all this VBA coding, you might as well design a proper VBA form and manage the user input yourself. This would give you full control over the data entry and you could transfer the text to the Word document when the user clicks an OK button.

    StuartR

Posting Permissions

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