Results 1 to 14 of 14
  1. #1
    Lounger
    Join Date
    May 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatically add rows in a form

    In an editable form, let's say I have the category "Stream" with five rows beneath it for the user to fill out with the name of each stream. Suppose there are six streams. Is it possible to have the form automatically/easily add a row or two as necessary, without the user having to go to Table, Insert Row? Also, each row has several columns. Thanks for any help you can provide!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatically add rows in a form

    In which application are you working?

  3. #3
    Lounger
    Join Date
    May 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically add rows in a form

    My apologies...Word 2003.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatically add rows in a form

    OK, I've moved the thread from the Windows 2003 forum to the Word forum - you'll have a better chance of getting a reply here. (Next time, please take a moment to think about the appropriate forum for your question).

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatically add rows in a form

    Use a separate table for each category. Place the category header ("Stream", for example) either in the first row of the table, or in a paragraph above the table.
    When the user reaches the last cell of the last row of the table for a category and presses Tab, Word will automatically add a new row to the table, with the same number of columns and the same formatting as the last row.

  6. #6
    Lounger
    Join Date
    May 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically add rows in a form

    I want to do more than just add a row. Each row has text fields and drop-down fields, and I want these fields to carry onto the new row the user is inserting. Please see the attached file.
    Attached Files Attached Files

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatically add rows in a form

    You'd have to create a macro that will duplicate the last row in the table.

    The attached version will do it automatically, but I suspect that is not desirable: each time the user leaves the last cell in the table, a new row will be created, so the user would have to take great care to avoid keeping on creating new rows <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

    (Frankly, I think your application would be more suitable for a database)
    Attached Files Attached Files

  8. #8
    Lounger
    Join Date
    May 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically add rows in a form

    Thanks--the macro worked. It added a row complete with the form fields. However, the cursor is going to the next available form field AFTER the new row. How can I get the cursor into the first form field of the new row? Note some changes in code from a colleague. (Sadly, I'm stuck with Word at the clien'ts request.)
    Attached Files Attached Files

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatically add rows in a form

    I think you attached the wrong document - there are no macros in it.

  10. #10
    Lounger
    Join Date
    May 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically add rows in a form

    Sorry...I just checked this file and I was able to see the code. Thanks for your help with this pesky form.
    Attached Files Attached Files

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatically add rows in a form

    Nope. Still no macros.

  12. #12
    Lounger
    Join Date
    May 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically add rows in a form

    Well, I'm stumped. I'm attaching a file with the VBA code so you can copy it into the document I sent previously. Hope that works.
    Attached Files Attached Files

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automatically add rows in a form

    OK, I see what you mean. I think you'll have to live with it, the jump to the next form field occurs after the macro ends, so even if you succeed in setting focus to a specific form field, this will be undone.

    I told you it was clunky. You're trying to make Word do things it wasn't designed for.

  14. #14
    Lounger
    Join Date
    May 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically add rows in a form

    Good to know we have done all we can do. Thanks for your help.

Posting Permissions

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